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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.