Identifier polyint Purpose Interpolate a set of N points by fitting a polynomial of degree N-1 Synopsis polyint, xp , yp , x, y Arguments Name I/O Type Description ----------------------------------------------------- xp I any except string input x array yp I any except string input y array x I any except string x value to be interpolated y O any except string y value corresponding to x Returns y - Scalar, interpolated value in (xp,yp) corresponding to x Description Interpolate a set of N points by fitting a polynomial of degree N-1. Adapted from algorithm in Numerical Recipes, Press et al. (1986) Section 3.1 (p82). Uses Neville's algorithm to iteratively build up the correct polynomial, with each iteration containing one higher order. Comment Example Find sin(2.5) by polynomial interpolation on sin(indgen(10)) IDL> xp = indgen(10) IDL> yp = sin( xp ) IDL> polyint, xp, yp, 2.5, y ,dy The above method gives y = .5988 and dy = 3.1e-4 a close approximation to the actual sin(2.5) = .5985 Dependencies CALLS: kwd_notset, sap_error CALLED FROM: flux_conserv, inter_pol Category ISAP Filename polyint.pro Author I. R. Khan Version 0.2 History 0.1 27-08-95 Design and code --> irk@ipac 0.2 01-11-95 Revised parameters --> irk@ipac checking/Error messages ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Copyright (C) 1995, California Institute of Technology. ; U.S. Government Sponsorship under NASA Contract NAS7-918 ; is acknowledged. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;