RMathGetLinearlyInterpolatedYOfXInUnorderedArray Method |
Gets the linearly interpolated y value of a given x value in an unordered array of x values and corresponding y values.
Namespace: Altaxo.CalcAssembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3572.0 (4.8.3572.0)
Syntaxpublic static double GetLinearlyInterpolatedYOfXInUnorderedArray(
ReadOnlySpan<double> xArray,
double x,
ReadOnlySpan<double> y,
bool extendToSides = false
)
Parameters
- xArray ReadOnlySpanDouble
- The x array.
- x Double
- The x value for which the y value should be calculated.
- y ReadOnlySpanDouble
- The y array, which must have the same length as the x array.
- extendToSides Boolean (Optional)
- If , extends the interpolation to the nearest side values when x is outside the range.
Return Value
DoubleThe linearly interpolated y value of the given x value. If x is outside the elements of the x array, null is returned.
See Also