[−][src]Trait geomath::prelude::Metric
Operations between objects of a metric space
A metric space is considered as a space where it exists a norm based on dot product. It can be the metric operations between two vectors or matrices such as the distance or the magnitude.
Note : For matrices and vectors you can also use operators : % for distance, | for dot product, ! for magnitude
Required methods
fn dot(&self, other: &Self) -> f64
Dot product of the two objects
fn distance2(&self, other: &Self) -> f64
Squared distance between the two objects
fn distance(&self, other: &Self) -> f64
Distance between the two objects
fn magnitude2(&self) -> f64
Squared magnitude of an object
fn magnitude(&self) -> f64
Magnitude of an object
fn set_normalized(&mut self) -> &mut Self
Normalizes the vector, ie. sets magnitude to 1 without changing direction
Provided methods
fn normalized(&self) -> Self
Get the normalized vector, ie. vector with same direction and magnitude 1
Implementors
impl Metric for Matrix2[src]
fn dot(&self, rhs: &Self) -> f64[src]
fn magnitude2(&self) -> f64[src]
fn magnitude(&self) -> f64[src]
fn distance2(&self, rhs: &Self) -> f64[src]
fn distance(&self, rhs: &Self) -> f64[src]
fn set_normalized(&mut self) -> &mut Self[src]
impl Metric for Matrix3[src]
fn dot(&self, rhs: &Self) -> f64[src]
fn magnitude2(&self) -> f64[src]
fn magnitude(&self) -> f64[src]
fn distance2(&self, rhs: &Self) -> f64[src]
fn distance(&self, rhs: &Self) -> f64[src]
fn set_normalized(&mut self) -> &mut Self[src]
impl Metric for Matrix4[src]
fn dot(&self, rhs: &Self) -> f64[src]
fn magnitude2(&self) -> f64[src]
fn magnitude(&self) -> f64[src]
fn distance2(&self, rhs: &Self) -> f64[src]
fn distance(&self, rhs: &Self) -> f64[src]
fn set_normalized(&mut self) -> &mut Self[src]
impl Metric for Vector2[src]
fn dot(&self, rhs: &Self) -> f64[src]
fn magnitude2(&self) -> f64[src]
fn magnitude(&self) -> f64[src]
fn distance2(&self, rhs: &Self) -> f64[src]
fn distance(&self, rhs: &Self) -> f64[src]
fn set_normalized(&mut self) -> &mut Self[src]
impl Metric for Vector3[src]
fn dot(&self, rhs: &Self) -> f64[src]
fn magnitude2(&self) -> f64[src]
fn magnitude(&self) -> f64[src]
fn distance2(&self, rhs: &Self) -> f64[src]
fn distance(&self, rhs: &Self) -> f64[src]
fn set_normalized(&mut self) -> &mut Self[src]
impl Metric for Vector4[src]
fn dot(&self, rhs: &Self) -> f64[src]
fn magnitude2(&self) -> f64[src]
fn magnitude(&self) -> f64[src]
fn distance2(&self, rhs: &Self) -> f64[src]
fn distance(&self, rhs: &Self) -> f64[src]
fn set_normalized(&mut self) -> &mut Self[src]
impl Metric for Vector6[src]
fn dot(&self, rhs: &Self) -> f64[src]
fn magnitude2(&self) -> f64[src]
fn magnitude(&self) -> f64[src]
fn distance2(&self, rhs: &Self) -> f64[src]
fn distance(&self, rhs: &Self) -> f64[src]
fn set_normalized(&mut self) -> &mut Self[src]
impl<T> Metric for Point<T> where
T: Metric + Copy + Clone + AddAssign<T> + SubAssign<T>, [src]
T: Metric + Copy + Clone + AddAssign<T> + SubAssign<T>,