Interpolation.CubicSpline Method

Definition

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

Overload List

CubicSpline(Double[], Double[]) Creates a natural cubic spline curve from the specified data points.
CubicSpline(Double[], Double[], CubicSplineKind) Creates a cubic spline curve from the specified data points with the specified spline kind.

CubicSpline(Double[], Double[])

Creates a natural cubic spline curve from the specified data points.
C#
public static CubicSpline CubicSpline(
	double[] xValues,
	double[] yValues
)

Parameters

xValues  Double[]
The x-coordinates of the data points. Must be strictly increasing.
yValues  Double[]
The y-coordinates of the data points.

Return Value

CubicSpline
A CubicSpline object that interpolates the data using natural boundary conditions.

Remarks

This method creates a natural cubic spline, which has zero second derivative at the endpoints. Natural splines tend to minimize overall curvature. The curve can be reused for efficient repeated evaluation and supports resampling, differentiation, and integration.

Exceptions

ArgumentNullExceptionxValues or yValues is null.
DimensionMismatchException The lengths of xValues and yValues do not match.

CubicSpline(Double[], Double[], CubicSplineKind)

Creates a cubic spline curve from the specified data points with the specified spline kind.
C#
public static CubicSpline CubicSpline(
	double[] xValues,
	double[] yValues,
	CubicSplineKind kind
)

Parameters

xValues  Double[]
The x-coordinates of the data points. Must be strictly increasing.
yValues  Double[]
The y-coordinates of the data points.
kind  CubicSplineKind
The kind of cubic spline to create.

Return Value

CubicSpline
A CubicSpline object that interpolates the data using the specified spline kind.

Remarks

This method creates a cubic spline with the specified boundary conditions or interpolation method. Available kinds include Natural, Akima, Monotonic, and NotAKnot. The curve can be reused for efficient repeated evaluation and supports resampling, differentiation, and integration.

Exceptions

ArgumentNullExceptionxValues or yValues is null.
DimensionMismatchException The lengths of xValues and yValues do not match.

See Also