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§
Sourcefn get_dimensions(&self) -> usize
fn get_dimensions(&self) -> usize
Number of dimensions for the point
Sourcefn apply_transformation(&mut self, transformation: &OMatrix<f32, Dyn, Dyn>)
fn apply_transformation(&mut self, transformation: &OMatrix<f32, Dyn, Dyn>)
Takes in a transformation matrix, applies it and updates the point
Sourcefn find_distance_squared(&self, other_point: &Self) -> f32
fn find_distance_squared(&self, other_point: &Self) -> f32
Euclidean distance squared between two points
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.