MathUtilGetInterval Method (Double, Double, Double) |
Finds the interval in a vector where the argument lays in between. Assumes that the vector has at least two elements.
The vector must increase strictly monotonically. If argument is below the first value, 0 is returned. If argument is above last value, the length of the vector is returned.
The result is the interval number, one based, meaning that the arg fullfills:
(vector[res-1] < arg && arg <= vector[res])
Also the scale factor for interpolating is returned. For linear interpolation
arg = vector[res-1] + fraction*(vector[res]-vector[res-1])
arg = (1-fraction)*vector[res-1] + fraction*vector[res]
If arg exists in vector, the result is such that
arg = vector[res]
Namespace: DHI.Mike1D.Generic
[Missing <returns> documentation for "M:DHI.Mike1D.Generic.MathUtil.GetInterval(System.Double,System.Double[],System.Double@)"]