Interpolation.Grid Cubic 2DInterpolator Method
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.1.0
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.1.0
Overload List
| Grid | Creates a grid-based cubic spline interpolator over a 2D rectilinear grid. |
| Grid | Creates a grid-based cubic spline interpolator over a 2D rectilinear grid. |
| Grid | Creates a grid-based cubic spline interpolator over a 2D rectilinear grid. |
GridCubic2DInterpolator(IReadOnlyList<IReadOnlyList<Double>>, IReadOnlyList<Double>, ExtrapolationMode)
Creates a grid-based cubic spline interpolator over a 2D rectilinear grid.
public static GridSurface GridCubic2DInterpolator(
IReadOnlyList<IReadOnlyList<double>> axes,
IReadOnlyList<double> values,
ExtrapolationMode extrapolation = ExtrapolationMode.Throw
)Parameters
- axes IReadOnlyList<IReadOnlyList<Double>>
- The coordinate vectors for each dimension (must have length 2 or 3).
- values IReadOnlyList<Double>
- The grid values in flat, row-major storage.
- extrapolation ExtrapolationMode (Optional)
- The extrapolation mode for out-of-range coordinates.
Return Value
GridSurfaceA specialized cubic grid surface: CubicGridSurface2D for 2D or CubicGridSurface3D for 3D.
Remarks
This method creates specialized cubic surfaces for 2D and 3D grids using natural cubic splines. For N-dimensional grids or custom boundary conditions, use GridCubicTensorSplineInterpolator instead.
Exceptions
| Argument | axes or values is null. |
| Argument | The product of axis lengths does not equal the values length, or an axis has fewer than 2 points. |
| Not | Thrown when the number of axes is not 2 or 3. |
GridCubic2DInterpolator(IReadOnlyList<Double>, IReadOnlyList<Double>, Matrix<Double>, ExtrapolationMode)
Creates a grid-based cubic spline interpolator over a 2D rectilinear grid.
public static CubicGridSurface2D GridCubic2DInterpolator(
IReadOnlyList<double> xAxis,
IReadOnlyList<double> yAxis,
Matrix<double> values,
ExtrapolationMode extrapolation = ExtrapolationMode.Throw
)Parameters
- xAxis IReadOnlyList<Double>
- The x-coordinates of the grid points.
- yAxis IReadOnlyList<Double>
- The y-coordinates of the grid points.
- values Matrix<Double>
- The grid values as a matrix (RowCount = xAxis.Count, ColumnCount = yAxis.Count).
- extrapolation ExtrapolationMode (Optional)
- The extrapolation mode for out-of-range coordinates.
Return Value
CubicGridSurface2DA CubicGridSurface2D that performs 2D bicubic interpolation.
Exceptions
| Argument | xAxis, yAxis, or values is null. |
| Argument | Matrix dimensions do not match axis lengths, or an axis has fewer than 2 points. |
GridCubic2DInterpolator(IReadOnlyList<Double>, IReadOnlyList<Double>, Double[,], ExtrapolationMode)
Creates a grid-based cubic spline interpolator over a 2D rectilinear grid.
public static CubicGridSurface2D GridCubic2DInterpolator(
IReadOnlyList<double> xAxis,
IReadOnlyList<double> yAxis,
double[,] values,
ExtrapolationMode extrapolation = ExtrapolationMode.Throw
)Parameters
- xAxis IReadOnlyList<Double>
- The x-coordinates of the grid points.
- yAxis IReadOnlyList<Double>
- The y-coordinates of the grid points.
- values Double[2]
- The grid values as a 2D array.
- extrapolation ExtrapolationMode (Optional)
- The extrapolation mode for out-of-range coordinates.
Return Value
CubicGridSurface2DA CubicGridSurface2D that performs 2D bicubic interpolation.
Remarks
Array dimension order
For the values array, the dimension order follows the order of the axis arguments.
The array must satisfy:
- values.GetLength(0) == xAxis.Count
- values.GetLength(1) == yAxis.Count
and values[i, j] = f(xAxis[i], yAxis[j]).
Exceptions
| Argument | xAxis, yAxis, or values is null. |
| Argument | Array dimensions do not match axis lengths, or an axis has fewer than 2 points. |