naginterfaces.library.interp.dim2_​scat

naginterfaces.library.interp.dim2_scat(x, y, f)[source]

dim2_scat generates a two-dimensional surface interpolating a set of scattered data points, using the method of Renka and Cline.

For full information please refer to the NAG Library document for e01sa

https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/e01/e01saf.html

Parameters
xfloat, array-like, shape

The coordinates of the th data point, for . The data points are accepted in any order, but see Further Comments.

yfloat, array-like, shape

The coordinates of the th data point, for . The data points are accepted in any order, but see Further Comments.

ffloat, array-like, shape

The coordinates of the th data point, for . The data points are accepted in any order, but see Further Comments.

Returns
triangint, ndarray, shape

A data structure defining the computed triangulation, in a form suitable for passing to dim2_scat_eval().

gradsfloat, ndarray, shape

The estimated partial derivatives at the nodes, in a form suitable for passing to dim2_scat_eval(). The derivatives at node with respect to and are contained in and respectively, for .

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

All nodes are collinear. There is no unique solution.

(errno )

On entry, , for , , .

Notes

In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

dim2_scat constructs an interpolating surface through a set of scattered data points , for , using a method due to Renka and Cline. In the plane, the data points must be distinct. The constructed surface is continuous and has continuous first derivatives.

The method involves firstly creating a triangulation with all the data points as nodes, the triangulation being as nearly equiangular as possible (see Cline and Renka (1984)). Then gradients in the - and -directions are estimated at node , for , as the partial derivatives of a quadratic function of and which interpolates the data value , and which fits the data values at nearby nodes (those within a certain distance chosen by the algorithm) in a weighted least squares sense. The weights are chosen such that closer nodes have more influence than more distant nodes on derivative estimates at node . The computed partial derivatives, with the values, at the three nodes of each triangle define a piecewise polynomial surface of a certain form which is the interpolant on that triangle. See Renka and Cline (1984) for more detailed information on the algorithm, a development of that by Lawson (1977). The code is derived from Renka (1984).

The interpolant can subsequently be evaluated at any point inside or outside the domain of the data by a call to dim2_scat_eval(). Points outside the domain are evaluated by extrapolation.

References

Cline, A K and Renka, R L, 1984, A storage-efficient method for construction of a Thiessen triangulation, Rocky Mountain J. Math. (14), 119–139

Lawson, C L, 1977, Software for surface interpolation, Mathematical Software III, (ed J R Rice), 161–194, Academic Press

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