RMathFindNearestIndex Method |
Finds the (fractional) index of the nearest element in the xVector to the xValue.
Namespace: Altaxo.CalcAssembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3448.0 (4.8.3448.0)
Syntaxpublic static (double index, bool isExact) FindNearestIndex(
IReadOnlyList<double> xVector,
double xValue
)
Parameters
- xVector IReadOnlyListDouble
- The x vector.
- xValue Double
- The x value.
Return Value
ValueTupleDouble,
BooleanA tuple, consisting of the nearest index, and a boolean value.
If any element of the xVector is equal to xValue, the boolean value is true.
Also, if xValue is between two elements of the xVector, the boolean value is true.
Otherwise, the boolean value is false, for instance, if the xValue is outside the limit of the elements of the xVector.
Exceptions
See Also