[][src]Struct pixel_engine::vector2::Vec2d

pub struct Vec2d<T> {
    pub x: T,
    pub y: T,
}

Basicly a glorified tuple

Fields

x: T

x

y: T

y

Implementations

impl<T> Vec2d<T>[src]

pub fn cast<U>(self) -> Vec2d<U> where
    U: From<T>, 
[src]

Cast the Vec2d to an other Vec2d with a differant inner type

impl<T> Vec2d<T> where
    T: Copy + Mul<T, Output = T> + Add<T, Output = T> + Div<T, Output = T> + Neg<Output = T> + Sub<T, Output = T> + From<f32> + Into<f32>, 
[src]

pub fn mag_f64(&self) -> f32[src]

Return the magnitude (hypotenus) of the given Vec2d as f64

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

Return the magnitude (hypotenus) of the given Vec2d as T

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

Return the magnitude (hypotenus) of the given Vec2d as T without doing the square root

pub fn norm(&self) -> Vec2d<T>[src]

Return a normalized version of the Vec2d

pub fn perp(&self) -> Vec2d<T>[src]

Return the normal of the given Vec2d

pub fn dot(&self, rhs: &Vec2d<T>) -> T[src]

Perform the dot product on the Vec2ds

pub fn cross(&self, rhs: &Vec2d<T>) -> T[src]

Perform the cross product on the Vec2ds

Trait Implementations

impl<T> Add<Vec2d<T>> for Vec2d<T> where
    T: Copy + Add<T, Output = T>, 
[src]

type Output = Vec2d<T>

The resulting type after applying the + operator.

impl<T> AddAssign<Vec2d<T>> for Vec2d<T> where
    T: Copy + AddAssign<T>, 
[src]

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

impl<T> Copy for Vec2d<T> where
    T: Copy
[src]

impl<T> Debug for Vec2d<T> where
    T: Debug
[src]

impl<T> Div<T> for Vec2d<T> where
    T: Copy + Div<T, Output = T>, 
[src]

type Output = Vec2d<T>

The resulting type after applying the / operator.

impl<T> Div<Vec2d<T>> for Vec2d<T> where
    T: Copy + Div<T, Output = T>, 
[src]

type Output = Vec2d<T>

The resulting type after applying the / operator.

impl<T> DivAssign<T> for Vec2d<T> where
    T: Copy + DivAssign<T>, 
[src]

impl<T> Eq for Vec2d<T> where
    T: Eq
[src]

impl<T> From<[T; 2]> for Vec2d<T> where
    T: Copy
[src]

impl<T> From<(T, T)> for Vec2d<T> where
    T: Copy
[src]

impl<T> Mul<T> for Vec2d<T> where
    T: Copy + Mul<T, Output = T>, 
[src]

type Output = Vec2d<T>

The resulting type after applying the * operator.

impl<T> Mul<Vec2d<T>> for Vec2d<T> where
    T: Copy + Mul<T, Output = T>, 
[src]

type Output = Vec2d<T>

The resulting type after applying the * operator.

impl<T> MulAssign<T> for Vec2d<T> where
    T: Copy + MulAssign<T>, 
[src]

impl<T> PartialEq<Vec2d<T>> for Vec2d<T> where
    T: PartialEq<T>, 
[src]

impl<T> Sub<Vec2d<T>> for Vec2d<T> where
    T: Copy + Sub<T, Output = T>, 
[src]

type Output = Vec2d<T>

The resulting type after applying the - operator.

impl<T> SubAssign<Vec2d<T>> for Vec2d<T> where
    T: Copy + SubAssign<T>, 
[src]

Auto Trait Implementations

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

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

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

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

impl<T> UnwindSafe for Vec2d<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> SetParameter for T

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

type Owned = T

The resulting type after obtaining ownership.

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.