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§

source

const DIM: usize

The dimension of the underlying real space

Required Methods§

source

fn coord(&self, axis: usize) -> f64

Access the coordinate value of the point along the given axis

source

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.

Implementations on Foreign Types§

source§

impl<const N: usize> Point for [f64; N]

N-dimensional real space using Euclidean distance

source§

const DIM: usize = N

source§

fn coord(&self, axis: usize) -> f64

source§

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

Implementors§