05-18-2009 02:46 PM
Hello!
I've read the help. And understand almost everything.
In this part:
The fractional index or x is 1, corresponding to the index of the first value of 5 the function finds. Suppose the array elements are 2.3, 5.2, 7.8, 7.9, 10.0, the start index is 0, and the threshold y is 6.5. The output is 1.5 because 6.5 is halfway between 5.2 (index 1) and 7.8 (index 2). If threshold y is 7 for the same set of numbers, the output is 1.69. If threshold y is 14.2, start index is 5, and the values in the array starting at index 5 are 9.1, 10.3, 12.9, and 15.5, threshold y falls between elements 7 and 8 because 14.2 is midway between 12.9 and 15.5. The value for fractional index or x is 7.5, that is, halfway between 7 and 8.
I understand how to get value "1,5" and "7,5". But could anyone explain me how is value "1.69" obtained??
05-18-2009 02:56 PM
linear interpolation. The line segment defined by points (index1) and (index2) gives you a slope of 2.6Y/X. 7 is 1.8Y greater than point 2.
(1.8Y/X) / 2.6Y + 1(start index) = 1.692X and change.
05-18-2009 02:58 PM
Hi aciduser,
1.69 = 1+ 0.69 = 1 + (7-5.2)/(7.8-5.2)
y threshold is 7 and falls between 5.2 and 7.8, hence the 1. The fractional part describes the distance to 5.2 compared to the distance between 5.2 and 7.8. Any questions?
05-18-2009 03:37 PM