GridSurface.CreateCubicTensorSpline Method

Creates a grid surface for N-dimensional interpolation using tensor-product cubic splines.

Definition

Namespace: Numerics.NET.Curves.Surfaces
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.1.0
C#
public static GridSurface CreateCubicTensorSpline(
	IReadOnlyList<IReadOnlyList<double>> axes,
	IReadOnlyList<double> values,
	GridBoundaryCondition boundaryCondition = default,
	ExtrapolationMode extrapolation = ExtrapolationMode.Throw
)

Parameters

axes  IReadOnlyList<IReadOnlyList<Double>>
The coordinate vectors for each dimension. Can be any dimension ≥ 1.
values  IReadOnlyList<Double>
The grid values in row-major order.
boundaryCondition  GridBoundaryCondition  (Optional)
The boundary condition for handling out-of-range samples when building interpolation stencils. Default is Clamp (clamp to edge).
extrapolation  ExtrapolationMode  (Optional)
The extrapolation mode for out-of-range query coordinates. Default is Throw.

Return Value

GridSurface
A grid surface using N-dimensional tensor-product cubic Hermite interpolation.

Remarks

This method creates a general N-dimensional tensor-product spline surface using the cubic Hermite kernel (CubicHermite). The interpolation is performed by recursively applying 1D cubic Hermite interpolation along each axis.

Difference from CreateCubic: While CreateCubic(IReadOnlyList<IReadOnlyList<Double>>, IReadOnlyList<Double>, ExtrapolationMode) creates specialized 2D/3D surfaces based on CubicSpline (2D/3D only), this method uses a general tensor-product approach that works for any dimension including 1D, 2D, 3D, and beyond.

Boundary conditions: The boundaryCondition parameter controls how the interpolant handles samples outside the grid bounds when assembling local stencils (e.g., at edges where a 4-point cubic stencil extends beyond the grid). This is distinct from extrapolation, which controls query-level behavior.

Kernel: This method uses the cubic Hermite kernel with centered finite differences (Catmull-Rom style slopes). For other kernels (linear, custom), use CreateTensorSpline(IReadOnlyList<IReadOnlyList<Double>>, IReadOnlyList<Double>, ISplineKernel1D, GridBoundaryCondition, ExtrapolationMode).

See Also