Trait HasDistanceTo

Source
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 for U also implements HasDistanceTo for T

Required Methods§

Source

fn sqr_distance(&self, other: &T) -> NonNegative

Should return the sqr distance to other

Provided Methods§

Source

fn distance(&self, other: &T) -> NonNegative

The distance to other

Implementors§