NAG Library Routine Document
E01SBF evaluates at a given point the two-dimensional interpolant function computed by
||M, TRIANG(7*M), IFAIL
||X(M), Y(M), F(M), GRADS(2,M), PX, PY, PF
E01SBF takes as input the parameters defining the interpolant
of a set of scattered data points
as computed by
and evaluates the interpolant at the point
If is equal to for some value of , the returned value will be equal to .
is not equal to
, the derivatives in GRADS
will be used to compute the interpolant. A triangle is sought which contains the point
, and the vertices of the triangle along with the partial derivatives and
values at the vertices are used to compute the value
. If the point
lies outside the triangulation defined by the input parameters, the returned value is obtained by extrapolation. In this case, the interpolating function
is extended linearly beyond the triangulation boundary. The method is described in more detail in Renka and Cline (1984)
and the code is derived from Renka (1984)
E01SBF must only be called after a call to
Renka R L (1984) Algorithm 624: triangulation and interpolation of arbitrarily distributed points in the plane ACM Trans. Math. Software 10 440–442
Renka R L and Cline A K (1984) A triangle-based interpolation method Rocky Mountain J. Math. 14 223–237
- 1: M – INTEGERInput
- 2: X(M) – REAL (KIND=nag_wp) arrayInput
- 3: Y(M) – REAL (KIND=nag_wp) arrayInput
- 4: F(M) – REAL (KIND=nag_wp) arrayInput
- 5: TRIANG() – INTEGER arrayInput
- 6: GRADS(,M) – REAL (KIND=nag_wp) arrayInput
must be unchanged from the previous call of E01SAF
- 7: PX – REAL (KIND=nag_wp)Input
- 8: PY – REAL (KIND=nag_wp)Input
On entry: the point at which the interpolant is to be evaluated.
- 9: PF – REAL (KIND=nag_wp)Output
On exit: the value of the interpolant evaluated at the point .
- 10: IFAIL – INTEGERInput/Output
must be set to
. If you are unfamiliar with this parameter you should refer to Section 3.3
in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
. When the value is used it is essential to test the value of IFAIL on exit.
unless the routine detects an error or a warning has been flagged (see Section 6
6 Error Indicators and Warnings
If on entry
, explanatory error messages are output on the current error message unit (as defined by X04AAF
Errors or warnings detected by the routine:
On entry, the triangulation information held in the array TRIANG
does not specify a valid triangulation of the data points. TRIANG
may have been corrupted since the call to E01SAF
The evaluation point (PX
) lies outside the nodal triangulation, and the value returned in PF
is computed by extrapolation.
Computational errors should be negligible in most practical situations.
The time taken for a call of E01SBF is approximately proportional to the number of data points, .
The results returned by this routine are particularly suitable for applications such as graph plotting, producing a smooth surface from a number of scattered points.