SPLINE

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.

Calling Sequence

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

Arguments

X

The abscissa vector. Values must be monotonically increasing.

Y

The vector of ordinate values corresponding to 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.

Example

The commands below show a typical use of SPLINE:

X = [2.,3.,4.] ; X values of original function

Y = (X-3)^2 ; Make a quadratic

T = FINDGEN(20)/10.+2 ; Values for interpolated points

Z = SPLINE(X,Y,T) ; Do the interpolation

See Also

SPL_INIT , SPLINE_P