Interpolation.Scattered Linear 2DInterpolator Method
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.1.0
Overload List
| Scattered | Creates a linear interpolator for 2D scattered data from a 2D array of points. |
| Scattered | Creates a linear interpolator for 2D scattered data from a matrix of points. |
| Scattered | Creates a linear interpolator for 2D scattered data using array inputs. |
| Scattered | Creates a linear interpolator for 2D scattered data using Delaunay triangulation. |
ScatteredLinear2DInterpolator(Double[,], Double[], ExtrapolationMode)
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
TriangulatedSurface2DA 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
| Argument | points is null, or values is null when points has 2 columns. |
| Argument | points 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)
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
TriangulatedSurface2DA 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
| Argument | points is null, or values is null when points has 2 columns. |
| Argument | points 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)
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
TriangulatedSurface2DA 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
| Argument | x, y, or values is null. |
| Argument | 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)
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
TriangulatedSurface2DA 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
| Argument | x, y, or values is null. |
| Argument | The lengths of x, y, and values do not match, or fewer than 3 points are provided. |