function coeffderiv, coeff ; NAME: ; COEFFDERIV ; ; PURPOSE: ; To calculate the coefficients of the derivative of a polynomial given ; its coefficients. ; ; CATEGORY: ; Data Reduction ; ; CALLING SEQUENCE: ; derivative coefficients = coeffderiv(coeff) ; ; INPUTS: ; coeff - A floating point vector containing coefficients of a polynomial, ; which the user wishes to differentiate. ; ; OUTPUTS: ; Returns a floating point vector containing the coefficients of the ; derivative of the polynomial specified by the input coefficients. ; ; KEYWORD PARAMETERS: ; None. ; ; PROCEDURES CALLED: ; None. ; ; PROCEDURE: ; The coefficients of the derivative are calculated using the rule ; d(C*x^n)/dx = n*C*x^(n-1). ; ; COMMON BLOCKS: ; None. ; ; SIDE EFFECTS: ; None. ; ; RESTRICTIONS: ; None. ; ; MODIFICATION HISTORY: ; 2002-04-08 - Written by J. R. Leong, Institute for Astronomy, UH at ; Manoa. ; Check the calling statement. if n_params() lt 1 then begin print, 'function - derivative coefficients = coeffderiv(coeff)' return, -1 endif ; Calculate the derivative coefficients. size = size(coeff) powers = indgen(size[1]) derivcoeff = powers*coeff derivcoeff = derivcoeff[1:*] return, derivcoeff end