home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / C-SSP.ARJ / CXCOSN.C < prev    next >
Encoding:
Text File  |  1984-08-08  |  304 b   |  16 lines

  1.    cxcosn(a,r)
  2.  
  3.       /*subroutine finds the cosine of a complex argument*/
  4.  
  5.       float a[],r[];
  6.  
  7.     {
  8.       double b,c;
  9.       extern double cos(),exp(),sin();
  10.  
  11.       b = exp(a[1]);
  12.       c = 1.0/b;
  13.       r[0] = cos(a[0]) * (b + c) * 0.5;
  14.       r[1] = -sin(a[0]) * (b - c) * 0.5;
  15.     }
  16.