;+ ; 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 ; ; $Id: legcheb.pro,v 1.1 2002/09/25 21:12:35 craigm Exp $ ; ;- ; Copyright (C) 2002, Craig Markwardt ; This software is provided as is without any warranty whatsoever. ; Permission to use, copy, modify, and distribute modified or ; unmodified copies is granted, provided this copyright and disclaimer ; are included unchanged. ;-