pub trait HasDistanceTo<T> {
// Required method
fn sqr_distance(&self, other: &T) -> NonNegative;
// Provided method
fn distance(&self, other: &T) -> NonNegative { ... }
}
Expand description
HasDistanceTo trait used for types which have a defined distance towards another T.
Implementing HasDistanceTo
Required Methods§
Sourcefn sqr_distance(&self, other: &T) -> NonNegative
fn sqr_distance(&self, other: &T) -> NonNegative
Should return the sqr distance to other
Provided Methods§
Sourcefn distance(&self, other: &T) -> NonNegative
fn distance(&self, other: &T) -> NonNegative
The distance to other