pub trait Distance: Into<Point2> {
// Provided methods
fn distance_squared<P: Into<Point2>>(self, other: P) -> f32 { ... }
fn distance<P: Into<Point2>>(self, other: P) -> f32 { ... }
fn is_closer<P: Into<Point2>>(self, distance: f32, other: P) -> bool { ... }
fn is_further<P: Into<Point2>>(self, distance: f32, other: P) -> bool { ... }
}Expand description
Basic trait for comparing distance.
Provided Methods§
Sourcefn distance_squared<P: Into<Point2>>(self, other: P) -> f32
fn distance_squared<P: Into<Point2>>(self, other: P) -> f32
Calculates squared euclidean distance from self to other.
Sourcefn distance<P: Into<Point2>>(self, other: P) -> f32
fn distance<P: Into<Point2>>(self, other: P) -> f32
Calculates euclidean distance from self to other.
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.