Point

Trait Point 

Source
pub trait Point {
    // Required methods
    fn get_dimensions(&self) -> usize;
    fn apply_transformation(&mut self, transformation: &OMatrix<f32, Dyn, Dyn>);
    fn find_distance_squared(&self, other_point: &Self) -> f32;
    fn to_vec(&self) -> Vec<f32>;
    fn from_matrix<S>(matrix: &Matrix<f32, Const<1>, Dyn, S>) -> Self
       where S: Storage<f32, Const<1>, Dyn>;
}
Expand description

trait definition for a point, implement these functions for your point struct

Required Methods§

Source

fn get_dimensions(&self) -> usize

Number of dimensions for the point

Source

fn apply_transformation(&mut self, transformation: &OMatrix<f32, Dyn, Dyn>)

Takes in a transformation matrix, applies it and updates the point

Source

fn find_distance_squared(&self, other_point: &Self) -> f32

Euclidean distance squared between two points

Source

fn to_vec(&self) -> Vec<f32>

Converts the point into a vector container

Source

fn from_matrix<S>(matrix: &Matrix<f32, Const<1>, Dyn, S>) -> Self
where S: Storage<f32, Const<1>, Dyn>,

Builds the point struct from a 1 dimensional matrix

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§