;> make this as its own function to streamline the c -> idl translation function cpolyval, nc, co, xv ; return, poly(xv, co) rr = 0. for ii=0, (nc-2) do rr = ( rr + co[(nc-1)-ii] ) * xv rr = rr + co[0] return, rr end ;/* ---------------------------------------------------------------------- ; Evaluate polynomial: y = f(x) = co[0] + c[1]*x + c[2]*x*x + ... ; Input: nc (number of coeffecients) ; Input: co (coeffecient array) ; Input: xv (x value) ; Returns function value. ;*/ ;/*@@*/ ;double cpolyval(int nc, double co[], double xv) ;{ ;/**/ ;int ii; ;double rr; ;/**/ ;rr = 0.; ;for (ii=0; ii < (nc-1); ++ii) { rr = ( rr + co[(nc-1)-ii] ) * xv; } ;rr = rr + co[0]; ;return(rr); ;}