Trait nannou::math::prelude::MetricSpace [−][src]
pub trait MetricSpace { type Metric: BaseFloat; fn distance2(self, other: Self) -> Self::Metric; fn distance(self, other: Self) -> Self::Metric { ... } }
A type with a distance function between values.
Examples are vectors, points, and quaternions.
Associated Types
Required Methods
fn distance2(self, other: Self) -> Self::Metric
Returns the squared distance.
This does not perform an expensive square root operation like in
MetricSpace::distance
method, and so can be used to compare distances
more efficiently.
Provided Methods
Implementations on Foreign Types
impl<S> MetricSpace for Point3<S> where
S: BaseFloat,
[src]
impl<S> MetricSpace for Point3<S> where
S: BaseFloat,
impl<S> MetricSpace for Point1<S> where
S: BaseFloat,
[src]
impl<S> MetricSpace for Point1<S> where
S: BaseFloat,
impl<S> MetricSpace for Vector3<S> where
S: BaseFloat,
[src]
impl<S> MetricSpace for Vector3<S> where
S: BaseFloat,
impl<S> MetricSpace for Vector2<S> where
S: BaseFloat,
[src]
impl<S> MetricSpace for Vector2<S> where
S: BaseFloat,
impl<S> MetricSpace for Point2<S> where
S: BaseFloat,
[src]
impl<S> MetricSpace for Point2<S> where
S: BaseFloat,
impl<S> MetricSpace for Vector4<S> where
S: BaseFloat,
[src]
impl<S> MetricSpace for Vector4<S> where
S: BaseFloat,
impl<S> MetricSpace for Vector1<S> where
S: BaseFloat,
[src]
impl<S> MetricSpace for Vector1<S> where
S: BaseFloat,
Implementors
impl<S> MetricSpace for Quaternion<S> where
S: BaseFloat, type Metric = S;impl<S> MetricSpace for nannou::geom::vector::Vector2<S> where
S: BaseFloat, type Metric = S;impl<S> MetricSpace for nannou::geom::vector::Vector3<S> where
S: BaseFloat, type Metric = S;impl<S> MetricSpace for nannou::geom::vector::Vector4<S> where
S: BaseFloat, type Metric = S;