Trait sif_kdtree::Point
source · pub trait Point {
const DIM: usize;
// Required methods
fn coord(&self, axis: usize) -> f64;
fn distance_2(&self, other: &Self) -> f64;
}Expand description
Defines a finite-dimensional real space in terms of coordinate values along a chosen set of axes
Required Associated Constants§
Required Methods§
sourcefn coord(&self, axis: usize) -> f64
fn coord(&self, axis: usize) -> f64
Access the coordinate value of the point along the given axis
sourcefn distance_2(&self, other: &Self) -> f64
fn distance_2(&self, other: &Self) -> f64
Return the squared distance between self and other.
This is called during nearest neighbour search and hence only the relation between two distance values is required so that computing square roots can be avoided.