How can I find index of spline point

This is highly un-scientific and could lead to the wrong result if your spline twists back onto itself or has a crazy shape (ie: you might return a local optima but not the very best solution)… but anyways food for thought in case there are no better ideas: Let’s say you have exactly 1,000 spline points for this example. Divide that set into 10 equal segments and test every hundredth point, as in #0, #100, #200, #300 thru #1000 to find the closest one. Let’s say #700 is the answer. Now drop down and test every tenth point centered from there, such as #650, #660, #670 thru #750. Let’s say #670 is the new answer. Drop one final time and test every point centered on that, from #665 thru #675. Now you’ve found a very close spline point in just 33 tests instead of 1,000… which should run much faster.