LEGCHEB Name
LEGCHEB
Author
Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
craigm@lheamail.gsfc.nasa.gov
UPDATED VERSIONs can be found on my WEB PAGE:
http://cow.physics.wisc.edu/~craigm/idl/idl.html
Purpose
Compute Legendre polynomial coefficents from Chebyshev coefficients
Major Topics
Curve and Surface Fitting, Special Functions
Calling Sequence
b = LEGCHEB(a)
Description
This routine computes the coefficients of a Legendre polynomial
expansion when the Chebyshev expansion is known.
Users can determine the Chebyshev expansion coefficients using a
routine like CHEBFIT, CHEBCOEF or CHEBGRID. Then, if the Legendre
expansion is needed instead, this conversion routine should be
used. Evaluation of the Legendre series can be performed using
the POLYLEG function in the IDL Astronomy Library.
Internally, the computational precision is double precision.
This routine relies upon the algorithm of Piessens (1974).
Inputs
A - a vector, the coefficients of the Chebyshev series of the
desired function.
Returns
The vector B, which contains the coefficients of the Legendre
polynomial expansion. Both A and B will have the same number of
elements and data type.
Keyword Parameters
NONE
Example
;; Compute the Chebyshev series coefficients of 1/(2-X) on [-1,1]
A = CHEBCOEF('1d/(2d - X)', /expr)
;; Convert to Legendre series coefficients
B = LEGCHEB(A)
References
Abramowitz, M. & Stegun, I., 1965, *Handbook of Mathematical
Functions*, 1965, U.S. Government Printing Office, Washington,
D.C. (Applied Mathematical Series 55)
Piessens, R. 1974, Comm. ACM, v. 17, p. 25 (TOMS 473)
Modification History
Written and documented, CM, 25 Sep 2002