[][src]Struct static_math::vector2::V2

pub struct V2<T>(_);

Implementations

impl<T> V2<T>[src]

pub fn new(input: [T; 2]) -> V2<T>[src]

impl<T: Num + Copy> V2<T>[src]

create a vector of all elements zeros

pub fn zeros() -> V2<T>[src]

impl<T: Float> V2<T>[src]

pub fn norm2(&self) -> T[src]

calculate the euclidean norm of the vector

pub fn normalize(&self) -> Result<Self, VectorErrors>[src]

normalize the current vector and return a new one

Trait Implementations

impl<T: Num + Copy> Add<V2<T>> for V2<T>[src]

type Output = Self

The resulting type after applying the + operator.

impl<T: Num + Copy> AddAssign<V2<T>> for V2<T>[src]

impl<T: Clone> Clone for V2<T>[src]

impl<T: Copy> Copy for V2<T>[src]

impl<T: Debug> Debug for V2<T>[src]

impl<T> Deref for V2<T>[src]

type Target = [T; 2]

The resulting type after dereferencing.

impl<T> DerefMut for V2<T>[src]

impl<T: Num + Display> Display for V2<T>[src]

impl<T> From<[T; 2]> for V2<T>[src]

impl<T: Num + Copy> Mul<M22<T>> for V2<T>[src]

type Output = V2<T>

The resulting type after applying the * operator.

impl<T: Num + Copy> Mul<T> for V2<T>[src]

type Output = V2<T>

The resulting type after applying the * operator.

impl<T: Num + Copy> Mul<V2<T>> for M22<T>[src]

type Output = V2<T>

The resulting type after applying the * operator.

impl<T: Num + Copy> Mul<V2<T>> for V2<T>[src]

type Output = T

The resulting type after applying the * operator.

impl Mul<V2<f32>> for f32[src]

type Output = V2<f32>

The resulting type after applying the * operator.

impl<T: PartialEq> PartialEq<V2<T>> for V2<T>[src]

impl<T> StructuralPartialEq for V2<T>[src]

impl<T: Num + Copy> Sub<V2<T>> for V2<T>[src]

type Output = Self

The resulting type after applying the - operator.

impl<T: Num + Copy> SubAssign<V2<T>> for V2<T>[src]

impl<T: Num + Copy> Zero for V2<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for V2<T> where
    T: RefUnwindSafe

impl<T> Send for V2<T> where
    T: Send

impl<T> Sync for V2<T> where
    T: Sync

impl<T> Unpin for V2<T> where
    T: Unpin

impl<T> UnwindSafe for V2<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.