function peval,c,x,deriv ; ; Evaluate the polynomial c[0]+c[1]*x+c[2]*x^2+..., or its derivative ; ; B. Knapp, 2000-02-10 ; n = N_ELEMENTS(c) if n_elements( deriv ) eq 0 then deriv=0 ; y = (x-x) for i=n-1,deriv,-1 do begin g = c[i] for j=0,deriv-1 do g=g*(i-j) y = y*x+g endfor return,y ; end