The SPLINE_P procedure performs parametric cubic spline interpolation with relaxed or clamped end conditions.
This routine is both more general and faster than the SPLINE function. One call to SPLINE_P is equivalent to two calls to SPLINE, as both the X and Y are interpolated with splines. It is suited for interpolating between randomly placed points, and the abscissa values need not be monotonic. In addition, the end conditions may be optionally specified via tangents.
This routine is written in the IDL language. Its source code can be found in the file
spline_p.pro
in the
lib
subdirectory of the IDL distribution.
Set this keyword equal to the desired interval in XY space between interpolants. If omitted, approximately 8 interpolants per XY segment will result.
The commands below show a typical use of SPLINE_P:
X = [0.,1,0,-1,0] ; Abscissas for square with a vertical diagonal
SPLINE_P, X, Y, XR, YR ; Interpolate with relaxed end conditions
As above, but with setting both the beginning and end tangents:
SPLINE_P, X, Y, XR, YR, TAN0=[1,0], TAN1=[1,0]
This yields approximately 32 interpolants.
As above, but with setting the interval to 0.05, making more interpolants, closer together:
SPLINE_P, X, Y, XR, YR, TAN0=[1,0], TAN1=[1,0], INTERVAL=0.05