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

  1.    lincng(a,nda,b,c)
  2.  
  3.       /*function to make a linear change of variables*/
  4.       /*in a given polynomial.*/
  5.  
  6.      int nda;
  7.      float a[],b[],c[];
  8.  
  9.    {
  10.      int i,nz;
  11.      float b1pwr;
  12.  
  13.       b1pwr = 1.0;
  14.       nz = nda;
  15.  
  16.       for(i = 0;i <= nz; i++)
  17.         c[i] = a[i];
  18.  
  19.       while(nz > 0)
  20.       {
  21.       for(i = 1; i <= nz; i++)
  22.        c[i] += c[i-1]*b[1];
  23.  
  24.       c[nz] = c[nz]*b1pwr;
  25.       b1pwr *= b[0];
  26.       nz--;
  27.       }
  28.       c[0] *=  b1pwr;
  29.    }
  30.  
  31.  
  32.