Trait sif_kdtree::Distance
source · pub trait Distance: Point {
// Required method
fn distance_2(&self, other: &Self) -> Self::Coord;
}Expand description
Extends the Point trait by a distance metric required for nearest neighbour search
Required Methods§
sourcefn distance_2(&self, other: &Self) -> Self::Coord
fn distance_2(&self, other: &Self) -> Self::Coord
Return the squared distance between self and other
This is called during nearest neighbour search and hence only the relation between two distance values is required so that computing square roots can be avoided.