Trait micromath::vector::Vector [−][src]
pub trait Vector<C>: Copy + Debug + Default + FromIterator<C> + Send + Sync where
C: Component, { const AXES: usize; fn get(self, index: usize) -> Option<C>; fn dot(self, rhs: Self) -> C; fn from_slice(slice: &[C]) -> Self { ... } fn iter(&self) -> Iter<'_, Self, C>ⓘ { ... } fn distance(self, rhs: Self) -> f32
where
C: Into<f32>, { ... } fn magnitude(self) -> f32
where
C: Into<f32>, { ... } }
This is supported on crate feature
vector
only.Algebraic vector generic over a given Component
type.
Associated Constants
Loading content...Required methods
fn get(self, index: usize) -> Option<C>
[src]
Get the component value for a particular index
fn dot(self, rhs: Self) -> C
[src]
Compute the dot product of two vectors
Provided methods
fn from_slice(slice: &[C]) -> Self
[src]
Instantiate a vector from a slice of components.
Panics if the slice is not the right size.
fn iter(&self) -> Iter<'_, Self, C>ⓘ
[src]
Iterate over the components of this vector
fn distance(self, rhs: Self) -> f32 where
C: Into<f32>,
[src]
C: Into<f32>,
Compute the distance between two vectors
fn magnitude(self) -> f32 where
C: Into<f32>,
[src]
C: Into<f32>,
Compute the magnitude of a vector