Interpolation.ScatteredLinear2DInterpolator Method

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.1.0

Overload List

ScatteredLinear2DInterpolator(Double[,], Double[], ExtrapolationMode) Creates a linear interpolator for 2D scattered data from a 2D array of points.
ScatteredLinear2DInterpolator(Matrix<Double>, Vector<Double>, ExtrapolationMode) Creates a linear interpolator for 2D scattered data from a matrix of points.
ScatteredLinear2DInterpolator(Double[], Double[], Double[], ExtrapolationMode) Creates a linear interpolator for 2D scattered data using array inputs.
ScatteredLinear2DInterpolator(Vector<Double>, Vector<Double>, Vector<Double>, ExtrapolationMode) Creates a linear interpolator for 2D scattered data using Delaunay triangulation.

ScatteredLinear2DInterpolator(Double[,], Double[], ExtrapolationMode)

Creates a linear interpolator for 2D scattered data from a 2D array of points.
C#
public static TriangulatedSurface2D ScatteredLinear2DInterpolator(
	double[,] points,
	double[]? values = null,
	ExtrapolationMode extrapolation = ExtrapolationMode.Throw
)

Parameters

points  Double[2]
A 2D array where each row contains a 2D point (x, y) or 3D point (x, y, z). Shape: (n, 2) or (n, 3).
values  Double[]  (Optional)
Function values at each point. Required if points has 2 columns; must be null if points has 3 columns (z values are in the array).
extrapolation  ExtrapolationMode  (Optional)
The extrapolation mode for out-of-range coordinates.

Return Value

TriangulatedSurface2D
A TriangulatedSurface2D that performs 2D scattered linear interpolation.

Remarks

This is a convenience overload that accepts a 2D array and converts it to a matrix internally before delegating to the primary implementation.

Exceptions

ArgumentNullExceptionpoints is null, or values is null when points has 2 columns.
ArgumentExceptionpoints does not have 2 or 3 columns, or values is provided when points has 3 columns, or values length does not match the number of points, or fewer than 3 points are provided.

ScatteredLinear2DInterpolator(Matrix<Double>, Vector<Double>, ExtrapolationMode)

Creates a linear interpolator for 2D scattered data from a matrix of points.
C#
public static TriangulatedSurface2D ScatteredLinear2DInterpolator(
	Matrix<double> points,
	Vector<double>? values = null,
	ExtrapolationMode extrapolation = ExtrapolationMode.Throw
)

Parameters

points  Matrix<Double>
A matrix where each row contains a 2D point (x, y) or 3D point (x, y, z). Shape: (n, 2) or (n, 3).
values  Vector<Double>  (Optional)
Function values at each point. Required if points has 2 columns; must be null if points has 3 columns (z values are in the matrix).
extrapolation  ExtrapolationMode  (Optional)
The extrapolation mode for out-of-range coordinates.

Return Value

TriangulatedSurface2D
A TriangulatedSurface2D that performs 2D scattered linear interpolation.

Remarks

This overload accepts a matrix representation of the scattered points, which is convenient when points and values are stored together.

Exceptions

ArgumentNullExceptionpoints is null, or values is null when points has 2 columns.
ArgumentExceptionpoints does not have 2 or 3 columns, or values is provided when points has 3 columns, or values length does not match the number of points, or fewer than 3 points are provided.

ScatteredLinear2DInterpolator(Double[], Double[], Double[], ExtrapolationMode)

Creates a linear interpolator for 2D scattered data using array inputs.
C#
public static TriangulatedSurface2D ScatteredLinear2DInterpolator(
	double[] x,
	double[] y,
	double[] values,
	ExtrapolationMode extrapolation = ExtrapolationMode.Throw
)

Parameters

x  Double[]
The x-coordinates of the scattered points.
y  Double[]
The y-coordinates of the scattered points.
values  Double[]
The function values at each scattered point.
extrapolation  ExtrapolationMode  (Optional)
The extrapolation mode for out-of-range coordinates.

Return Value

TriangulatedSurface2D
A TriangulatedSurface2D that performs 2D scattered linear interpolation.

Remarks

This is a convenience overload that accepts array inputs and converts them to vectors internally before delegating to the primary implementation.

Exceptions

ArgumentNullExceptionx, y, or values is null.
ArgumentException The lengths of x, y, and values do not match, or fewer than 3 points are provided.

ScatteredLinear2DInterpolator(Vector<Double>, Vector<Double>, Vector<Double>, ExtrapolationMode)

Creates a linear interpolator for 2D scattered data using Delaunay triangulation.
C#
public static TriangulatedSurface2D ScatteredLinear2DInterpolator(
	Vector<double> x,
	Vector<double> y,
	Vector<double> values,
	ExtrapolationMode extrapolation = ExtrapolationMode.Throw
)

Parameters

x  Vector<Double>
The x-coordinates of the scattered points.
y  Vector<Double>
The y-coordinates of the scattered points.
values  Vector<Double>
The function values at each scattered point.
extrapolation  ExtrapolationMode  (Optional)
The extrapolation mode for out-of-range coordinates.

Return Value

TriangulatedSurface2D
A TriangulatedSurface2D that performs 2D scattered linear interpolation.

Remarks

This method constructs a Delaunay triangulation of the 2D points and performs barycentric interpolation within triangles. This method is restricted to 2D data.

The extrapolation parameter controls behavior when the query point is outside the triangulated domain.

Exceptions

ArgumentNullExceptionx, y, or values is null.
ArgumentException The lengths of x, y, and values do not match, or fewer than 3 points are provided.

See Also