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.