Trait vectors::Distance [] [src]

pub trait Distance: Sized {
    type Scalar;
    fn squared_distance(&self, rhs: &Self) -> Self::Scalar;

    fn distance(&self, rhs: &Self) -> Self::Scalar
    where
        Self::Scalar: Real
, { ... } }

The trait for types supporting the calculation of distance

Associated Types

The scalar type returned by self's distance

Required Methods

Calculates the squared euclidian distance between self and rhs.

Provided Methods

Calculates the euclidian distance between self and rhs.

Implementors