Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]

SPLINE


Syntax | Return Value | Arguments | Keywords | Examples | Version History | See Also

The SPLINE function performs cubic spline interpolation.

This routine is written in the IDL language. Its source code can be found in the file spline.pro in the lib subdirectory of the IDL distribution.

Syntax

Result = SPLINE( X, Y, T [, Sigma] [, /DOUBLE] )

Return Value

Returns the result of the cubic spline interpolation. If X, Y, or T are of type double-precision, then the computations will be done using double-precision and a double-precision result will be returned. Otherwise, single-precision will be used.

Arguments

X

The abscissa vector. Values must be monotonically increasing. X must have three or more points.

Y

The vector of ordinate values corresponding to X. Y should have the same number of elements as X.

T

The vector of abscissa values for which the ordinate is desired. The values of T must be monotonically increasing.

Sigma

The amount of "tension" that is applied to the curve. The default value is 1.0. If sigma is close to 0, (e.g., .01), then effectively there is a cubic spline fit. If sigma is large, (e.g., greater than 10), then the fit will be like a polynomial interpolation.

Keywords

DOUBLE

Set this keyword to perform computations using double-precision arithmetic and to return a double-precision result.

Examples

The commands below show a typical use of SPLINE:

; X values of original function: 
X = [2.,3.,4.] 
 
; Make a quadratic 
Y = (X-3)^2 
;Values for interpolated points: 
T = FINDGEN(20)/10.+2 
 
; Do the interpolation: 
Z = SPLINE(X,Y,T) 

Version History

Introduced: Original

DOUBLE keyword added: 6.1

See Also

SPL_INIT, SPLINE_P


Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]