The INTERPOL function performs linear interpolation on vectors with a regular or irregular grid. The result is a single- or double-precision floating-point vector, or a complex vector if the input vector is complex.
This routine is written in the IDL language. Its source code can be found in the file
interpol.pro
in the
lib
subdirectory of the IDL distribution.
The number of points in the result when both input and output grids are regular. The abscissa values for the output grid will contain the same endpoints as the input.
Create a floating-point vector of 61 elements in the range [-3, 3].
V = SIN(X) ; Evaluate V[x] at each point .
U = [-2.50, -2.25, -1.85, -1.55, -1.20, -0.85, -0.50, -0.10, $
0.30, 0.40, 0.75, 0.85, 1.05, 1.45, 1.85, 2.00, 2.25, 2.75 ]
;
Define X-values where interpolates are desired.
result = INTERPOL(V, X, U) ; Interpolate.