NAG Library Function Document
nag_2d_triang_eval (e01skc) evaluates at a given point the two-dimensional interpolant function computed by
||nag_2d_triang_eval (Integer m,
const double x,
const double y,
const double f,
const Integer triang,
const double grads,
nag_2d_triang_eval (e01skc) takes as input the arguments 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 arguments, 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)
nag_2d_triang_eval (e01skc) 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
m – IntegerInput
x[m] – const doubleInput
y[m] – const doubleInput
f[m] – const doubleInput
triang – const IntegerInput
grads – const doubleInput
must be unchanged from the previous call of
px – doubleInput
py – doubleInput
On entry: the point at which the interpolant is to be evaluated.
pf – double *Output
On exit: the value of the interpolant evaluated at the point .
fail – NagError *Input/Output
The NAG error argument (see Section 3.6
in the Essential Introduction).
6 Error Indicators and Warnings
On entry, argument had an illegal value.
On entry, .
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG
On entry, triang
does not contain a valid data point triangulation; triang
may have been corrupted since the call to
Warning – the evaluation point lies outside the triangulation boundary. The returned value was computed by extrapolation.
Computational errors should be negligible in most practical situations.
The time taken for a call of nag_2d_triang_eval (e01skc) is approximately proportional to the number of data points, .
The results returned by this function are particularly suitable for applications such as graph plotting, producing a smooth surface from a number of scattered points.
in nag_2d_shep_interp (e01sgc).