pub fn nearest_t<F>(
p: Vector2<f32>,
f: F,
t_range: RangeInclusive<f32>,
options: NearestOptions,
) -> NearestResultExpand description
Find nearest parameter t to point p on curve f(t) over t_range.
- Uses multi-start local minimization of the squared distance seeded by
uniform sampling. This is robust for most curves without requiring
derivatives. If you have an analytic derivative, consider
nearest_t_with_derivativefor potentially faster convergence. - Returns
NearestResultwith the closest point and (signed) distance.