Trait EuclideanDistance

Source
pub trait EuclideanDistance<T, Rhs = Self> {
    // Required methods
    fn euclidean_distance(&self, rhs: &Rhs) -> T;
    fn euclidean_squared(&self, rhs: &Rhs) -> T;
}

Required Methods§

Source

fn euclidean_distance(&self, rhs: &Rhs) -> T

Source

fn euclidean_squared(&self, rhs: &Rhs) -> T

It is especially suitable when only the length needs to be compared

a square root operation is generally 14 instruction cycles

and the square root cannot be used in some spaces, like Z^n

Implementors§

Source§

impl<T> EuclideanDistance<T> for Point<T>
where T: Real,

Source§

impl<T> EuclideanDistance<T, PointSet<T>> for Point<T>
where T: Float + PartialOrd,

Source§

impl<T: Float> EuclideanDistance<T, Circle<T>> for Point<T>

Source§

impl<T: Float> EuclideanDistance<T, Line<T>> for Point<T>

Source§

impl<T: Float> EuclideanDistance<T, Triangle<T>> for Point<T>