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>

Notable traits for Iter<'a, V, C>

impl<'a, V, C> Iterator for Iter<'a, V, C> where
    V: Vector<C>,
    C: Component
type Item = 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

const AXES: usize[src]

Number of axes

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

Loading content...

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>

Notable traits for Iter<'a, V, C>

impl<'a, V, C> Iterator for Iter<'a, V, C> where
    V: Vector<C>,
    C: Component
type Item = C;
[src]

Iterate over the components of this vector

fn distance(self, rhs: Self) -> f32 where
    C: Into<f32>, 
[src]

Compute the distance between two vectors

fn magnitude(self) -> f32 where
    C: Into<f32>, 
[src]

Compute the magnitude of a vector

Loading content...

Implementors

impl<C> Vector<C> for Vector2d<C> where
    C: Component
[src]

impl<C> Vector<C> for Vector3d<C> where
    C: Component
[src]

Loading content...