Distance

Trait Distance 

Source
pub trait Distance: Point {
    // Required methods
    fn l1_distance(self, other: Self) -> Self::Scalar;
    fn l2_distance_squared(self, other: Self) -> Self::Scalar;
}

Required Methods§

Source

fn l1_distance(self, other: Self) -> Self::Scalar

The L1 distance between points.

Source

fn l2_distance_squared(self, other: Self) -> Self::Scalar

The square of the L2 (Euclidean) distance between points.

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.

Implementors§

Source§

impl<T> Distance for PointN<[T; 2]>
where T: Add<Output = T> + Pow<u16, Output = T> + Copy + Signed, PointN<[T; 2]>: Point<Scalar = T>,

Source§

impl<T> Distance for PointN<[T; 3]>
where T: Add<Output = T> + Pow<u16, Output = T> + Copy + Signed, PointN<[T; 3]>: Point<Scalar = T>,