home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / C-SSP.ARJ / CXPLYM.C < prev    next >
Encoding:
Text File  |  1984-06-21  |  590 b   |  31 lines

  1.     cxplym(a,b,c,d,nda,ndc,e,f,nde)
  2.  
  3.       /*the purpose of this function is to multply two polynomials*/
  4.       /*with complex coefficients.*/
  5.  
  6.       int nda,ndc,*nde;
  7.       float a[],b[],c[],d[],e[],f[];
  8.  
  9.     {
  10.       int i,j,ipj,n;
  11.  
  12.       *nde = nda + ndc;
  13.       n = *nde;
  14.  
  15.       for(i = 0;i <= n; i++)
  16.       {
  17.        e[i] = 0.0;
  18.        f[i] = 0.0;
  19.       }
  20.  
  21.       for(i = 0;i <= nda; i++)
  22.        for(j = 0;j <= ndc; j++)
  23.        {
  24.         ipj = i + j;
  25.         e[ipj] += (a[i]*c[j]) - (b[i]*d[j]);
  26.         f[ipj] += (b[i]*c[j]) + (a[i]*d[j]);
  27.        }
  28.     }
  29.  
  30.  
  31.