[−][src]Trait spade::PointN
Abstraction over a point with a fixed number of dimensions.
Spade will work with any point type implementing this trait, at the
moment points of the cgmath
and nalgebra
crates are supported.
Also, the trait is implemented for fixed arrays of length 2, 3 and 4, allowing
to use spade's datastructures with fixed size arrays as point coordinates.
That means that the trait's methods are also implemented for
these array types, thus be careful when importing PointN
.
Implement this if you want spade to support your own point types.
Also, an empty implementation of TwoDimensional
or ThreeDimensional
should be given if appropriate.
Associated Types
Loading content...Required methods
fn dimensions() -> usize
The (fixed) number of dimensions of this point type.
fn from_value(value: Self::Scalar) -> Self
Creates a new point with all components set to a certain value.
fn nth(&self, index: usize) -> &Self::Scalar
Returns the nth element of this point.
fn nth_mut(&mut self, index: usize) -> &mut Self::Scalar
Returns a mutable reference to the nth element of this point.