Trait Point

Source
pub trait Point {
    type Coord: Num + Copy + PartialOrd;

    const DIM: usize;

    // Required method
    fn coord(&self, axis: usize) -> Self::Coord;
}
Expand description

Defines a finite-dimensional space in terms of coordinate values along a chosen set of axes

Required Associated Constants§

Source

const DIM: usize

The dimension of the underlying space

Required Associated Types§

Source

type Coord: Num + Copy + PartialOrd

The type of the coordinate values

Required Methods§

Source

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

Access the coordinate value of the point along the given axis

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.

Implementations on Foreign Types§

Source§

impl<T, const N: usize> Point for [T; N]
where T: Num + Copy + PartialOrd,

N-dimensional space using Euclidean distance

Source§

const DIM: usize = N

Source§

type Coord = T

Source§

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

Implementors§