Interpolation.LogLinear Method

Performs log-linear interpolation at a single point.

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.0.0
C#
public static double LogLinear(
	ReadOnlySpan<double> xValues,
	ReadOnlySpan<double> yValues,
	double x
)

Parameters

xValues  ReadOnlySpan<Double>
The x-coordinates of the data points. Must be strictly increasing.
yValues  ReadOnlySpan<Double>
The y-coordinates of the data points. Must be positive.
x  Double
The x-coordinate at which to interpolate.

Return Value

Double
The interpolated y-value in linear units.

Remarks

This method performs linear interpolation in x and logarithmic interpolation in y. The y-values must be positive. The result is returned in linear units.

This method throws an exception if x is outside the range of xValues.

Exceptions

ArgumentNullExceptionxValues or yValues is null.
ArgumentExceptionxValues and yValues have different lengths, or contain fewer than 2 elements.
ArgumentOutOfRangeExceptionx is outside the range of xValues, or any bracketing y-value is not positive.

See Also