Point

Trait Point 

Source
pub trait Point {
    // Required method
    fn dist(&self, other: &Self) -> f64;

    // Provided method
    fn dist_lower_bound(&self, other: &Self) -> f64 { ... }
}
Expand description

A point in some (metric) space.

Required Methods§

Source

fn dist(&self, other: &Self) -> f64

Accurate compute the distance from self to other.

This should be real and non-negative, or else algorithms may return unexpected results.

Provided Methods§

Source

fn dist_lower_bound(&self, other: &Self) -> f64

Compute an estimate of the distance from self to other.

This should be less than or equal to self.dist(other) or else algorithms may return unexpected results.

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.

Implementors§

Source§

impl Point for Euclid<[f64; 1]>

Source§

impl Point for Euclid<[f64; 2]>

Source§

impl Point for Euclid<[f64; 3]>

Source§

impl Point for Euclid<[f64; 4]>

Source§

impl Point for Euclid<[f64; 5]>

Source§

impl Point for Euclid<[f64; 6]>

Source§

impl Point for Euclid<[f64; 7]>

Source§

impl Point for Euclid<[f64; 8]>

Source§

impl Point for Euclid<[f64; 9]>

Source§

impl Point for Euclid<[f64; 10]>

Source§

impl Point for Euclid<[f64; 11]>

Source§

impl Point for Euclid<[f64; 12]>