pub trait Distance<P>where
P: Point,{
// Required method
fn distance_2(&self, point: &P) -> P::Coord;
// Provided method
fn contains(&self, point: &P) -> bool { ... }
}Expand description
Defines a distance metric between a type (objects, points, AABB, etc.) and points
Required Methods§
Sourcefn distance_2(&self, point: &P) -> P::Coord
fn distance_2(&self, point: &P) -> P::Coord
Return the squared distance between self and point
Generally, only the relation between two distance values is required so that computing square roots can be avoided.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".