Interpolation.Monotone Cubic Method
Performs monotone cubic spline interpolation at a single point.
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.0.0
C#
The interpolated y-value at x.
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.0.0
public static double MonotoneCubic(
double[] xValues,
double[] yValues,
double x
)Parameters
- xValues Double[]
- The x-coordinates of the data points. Must be strictly increasing.
- yValues Double[]
- The y-coordinates of the data points.
- x Double
- The x-coordinate at which to interpolate.
Return Value
DoubleThe interpolated y-value at x.
Remarks
This method creates a temporary monotone cubic spline curve object that preserves the monotonicity of the data and evaluates it at the specified point. Note: This method should only be used for one-off calculations. For repeated evaluations on the same data, use MonotoneCubicSpline(Double[], Double[]) to create a reusable curve object, which will be more efficient.
Exceptions
| Argument | xValues or yValues is null. |
| Dimension | The lengths of xValues and yValues do not match. |
| Argument | xValues does not have at least 2 elements, or the values in xValues are not strictly increasing. |