Interpolation.Piecewise Constant Curve Method
Creates a piecewise constant curve from the specified data points.
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.0.0
C#
A PiecewiseConstantCurve(Double[], Double[]) object that interpolates the data.
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.0.0
public static PiecewiseConstantCurve PiecewiseConstantCurve(
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
PiecewiseConstantCurveA PiecewiseConstantCurve(Double[], Double[]) object that interpolates the data.
Remarks
This method creates a curve that is constant between consecutive data points (step function). The curve is left-continuous, meaning that at each data point, the function value is equal to the y-value at that point. The curve can be reused for efficient repeated evaluation and supports resampling via the Resample(IInterpolator, Double[]) extension method.
Exceptions
| Argument | xValues or yValues is null. |
| Dimension | The lengths of xValues and yValues do not match. |