Interpolation.Cubic Spline Method
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.0.0
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.0.0
Overload List
| Cubic | Creates a natural cubic spline curve from the specified data points. |
| Cubic | 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.
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
CubicSplineA 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
| Argument | xValues or yValues is null. |
| Dimension | 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.
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
CubicSplineA 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
| Argument | xValues or yValues is null. |
| Dimension | The lengths of xValues and yValues do not match. |