pub trait EuclideanDistance: Sized {
// Required method
fn distance_squared(&self, other: &Self) -> f32;
// Provided method
fn distance(&self, other: &Self) -> f32 { ... }
}
Expand description
Calculate the distance between this and another color as if they were coordinates in a Euclidean space. Alpha is not considered in the distance calculation.
Required Methods§
Sourcefn distance_squared(&self, other: &Self) -> f32
fn distance_squared(&self, other: &Self) -> f32
Distance squared from self
to other
.
Provided Methods§
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.