Close
Close window
NaturalNeighborInterpolation - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


[フレーム] [フレーム]

Interpolation

NaturalNeighborInterpolation

interpolate 2-D scattered data using the natural neighbor interpolation method

Calling Sequence

NaturalNeighborInterpolation(xy,z)

f:=NaturalNeighborInterpolation(xy,z)

f(x,y)

f(M)

Parameters

xy

-

listlist, Array, or Matrix of the form x1,y1,x2,y2,,xn,yn; the (x,y) coordinates of the sample points

z

-

list, Array, or Vector of sample values corresponding to the (x,y) points

x,y

-

evaluate f at (x,y)

M

-

a k x 2 Matrix of points at which to evaluate f

Description

The NaturalNeighborInterpolation command creates a function fx,y=z which can then be evaluated at arbitrary points within the convex hull of the sample points.

The natural neighbor triangular interpolant is defined as follows. First, the Voronoi diagram on the given input points xy is determined. Now, to find fx,y, find what would change if the point x,y would be added to the Voronoi diagram: some of the polygons would shrink to make space for a polygon around x,y. If the polygon around point xi,yi would shrink by area wi, then the value of the interpolant fx,y is defined as the weighted average of the values zi, weighted by weights wi.

A natural neighbor interpolant is C1 continuous except at the sample points.

This interpolation method does not introduce local minima or maxima or infer trends which are not already present in the input data.

Results may be poor when interpolating near the convex hull of the sample points.

Evaluating f at points outside of the convex hull produces Floatundefined.

As with all interpolation methods, the interpolant f always passes through all of the sample values.

Input sample points must not contain duplicates. The presence of duplicate points can lead to unexpected results.

In order to evaluate f at k points, you can put each point in a row of a Matrix M and call f(M) to obtain the k values of f in a k-element Vector. This will be most efficient if M's options are such that its datatype is float[8], its order is C_order, and its storage is rectangular.

Examples

>

XY0,0,1,0,2,0,0,1,1,1,2,1,0,2,1,2,2,2

XY0,0,1,0,2,0,0,1,1,1,2,1,0,2,1,2,2,2

(1)
>

Z0,0,0,0,1,0,0,0,0

Z0,0,0,0,1,0,0,0,0

(2)
>

fInterpolation:-NaturalNeighborInterpolationXY,Z

fNatural Neighbor interpolation object with 9 sample points

(3)

f can be polled at specific points.

>

f0.5,0.5

0.250000000000000

(4)
>

MMatrix1.5,0.3,0.7,1.4,1.2,1.8,datatype=float8,order=C_order

M1.500000000000000.3000000000000000.7000000000000001.400000000000001.200000000000001.80000000000000

(5)
>

fM

0.1500000000000000.4200000000000000.160000000000000

(6)

Use plot3d to plot the interpolated surface.

>

plot3dx,yfx,y,0..2,0..2,labels=x,y,z

Compatibility

The Interpolation[NaturalNeighborInterpolation] command was introduced in Maple 2018.

For more information on Maple 2018 changes, see Updates in Maple 2018 .

See Also


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /