[][src]Trait building_blocks::prelude::Distance

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

Required methods

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

The L1 distance between points.

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

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

Loading content...

Implementors

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

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

Loading content...