Skip to main content

nearest_point

Function nearest_point 

Source
pub fn nearest_point(
    points: impl IntoIterator<Item = (f64, f64)>,
    target: (f64, f64),
    scale: (f64, f64),
) -> Option<(usize, f64)>
Expand description

Index and distance of the point closest to target, with each axis divided by scale (so distances are comparable). Non-finite points are skipped.