[−][src]Struct pixel_engine::vector2::Vec2d
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]
U: From<T>,
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]
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>,
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]
T: Copy + Add<T, Output = T>,
type Output = Vec2d<T>
The resulting type after applying the +
operator.
fn add(self, rhs: Vec2d<T>) -> <Vec2d<T> as Add<Vec2d<T>>>::Output
[src]
impl<T> AddAssign<Vec2d<T>> for Vec2d<T> where
T: Copy + AddAssign<T>,
[src]
T: Copy + AddAssign<T>,
fn add_assign(&mut self, rhs: Vec2d<T>)
[src]
impl<T> Clone for Vec2d<T> where
T: Clone,
[src]
T: Clone,
impl<T> Copy for Vec2d<T> where
T: Copy,
[src]
T: Copy,
impl<T> Debug for Vec2d<T> where
T: Debug,
[src]
T: Debug,
impl<T> Div<T> for Vec2d<T> where
T: Copy + Div<T, Output = T>,
[src]
T: Copy + Div<T, Output = T>,
type Output = Vec2d<T>
The resulting type after applying the /
operator.
fn div(self, rhs: T) -> <Vec2d<T> as Div<T>>::Output
[src]
impl<T> Div<Vec2d<T>> for Vec2d<T> where
T: Copy + Div<T, Output = T>,
[src]
T: Copy + Div<T, Output = T>,
type Output = Vec2d<T>
The resulting type after applying the /
operator.
fn div(self, rhs: Vec2d<T>) -> <Vec2d<T> as Div<Vec2d<T>>>::Output
[src]
impl<T> DivAssign<T> for Vec2d<T> where
T: Copy + DivAssign<T>,
[src]
T: Copy + DivAssign<T>,
fn div_assign(&mut self, rhs: T)
[src]
impl<T> Eq for Vec2d<T> where
T: Eq,
[src]
T: Eq,
impl<T> From<[T; 2]> for Vec2d<T> where
T: Copy,
[src]
T: Copy,
impl<T> From<(T, T)> for Vec2d<T> where
T: Copy,
[src]
T: Copy,
impl<T> Mul<T> for Vec2d<T> where
T: Copy + Mul<T, Output = T>,
[src]
T: Copy + Mul<T, Output = T>,
type Output = Vec2d<T>
The resulting type after applying the *
operator.
fn mul(self, rhs: T) -> <Vec2d<T> as Mul<T>>::Output
[src]
impl<T> Mul<Vec2d<T>> for Vec2d<T> where
T: Copy + Mul<T, Output = T>,
[src]
T: Copy + Mul<T, Output = T>,
type Output = Vec2d<T>
The resulting type after applying the *
operator.
fn mul(self, rhs: Vec2d<T>) -> <Vec2d<T> as Mul<Vec2d<T>>>::Output
[src]
impl<T> MulAssign<T> for Vec2d<T> where
T: Copy + MulAssign<T>,
[src]
T: Copy + MulAssign<T>,
fn mul_assign(&mut self, rhs: T)
[src]
impl<T> PartialEq<Vec2d<T>> for Vec2d<T> where
T: PartialEq<T>,
[src]
T: PartialEq<T>,
impl<T> Sub<Vec2d<T>> for Vec2d<T> where
T: Copy + Sub<T, Output = T>,
[src]
T: Copy + Sub<T, Output = T>,
type Output = Vec2d<T>
The resulting type after applying the -
operator.
fn sub(self, rhs: Vec2d<T>) -> <Vec2d<T> as Sub<Vec2d<T>>>::Output
[src]
impl<T> SubAssign<Vec2d<T>> for Vec2d<T> where
T: Copy + SubAssign<T>,
[src]
T: Copy + SubAssign<T>,
fn sub_assign(&mut self, rhs: Vec2d<T>)
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Vec2d<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Vec2d<T> where
T: Send,
T: Send,
impl<T> Sync for Vec2d<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Vec2d<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Vec2d<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,