[−][src]Struct olc_pixel_game_engine::V2d
Generic 2D vector type. See Vf2d
and Vi2d
for more information.
Don't use this generic struct directly.
Prefer using Vf2d
(alias for V2d<f32>
) and Vi2d
(alias for V2d<i32>
)
instead.
This struct is only exported to show available functions and implemented traits.
Fields
x: T
y: T
Implementations
impl<T> V2d<T>
[src]
impl V2d<i32>
[src]
pub fn mag(&self) -> i32
[src]
Returns magnitude (or length) of a vector.
pub fn mag2(&self) -> i32
[src]
Returns magnitude squared.
pub fn norm(&self) -> Self
[src]
Returns vector norm.
pub fn perp(&self) -> Self
[src]
Returns perpendicular vector.
pub fn dot(&self, rhs: Vi2d) -> i32
[src]
Returns dot product of two vectors.
pub fn cross(&self, rhs: Vi2d) -> i32
[src]
Returns cross product of two vectors.
impl V2d<f32>
[src]
pub fn mag(&self) -> f32
[src]
Returns magnitude (or length) of a vector.
pub fn mag2(&self) -> f32
[src]
Returns magnitude squared.
pub fn norm(&self) -> Self
[src]
Returns vector norm.
pub fn perp(&self) -> Self
[src]
Returns perpendicular vector.
pub fn dot(&self, rhs: Vf2d) -> f32
[src]
Returns dot product of two vectors.
pub fn cross(&self, rhs: Vf2d) -> f32
[src]
Returns cross product of two vectors.
Trait Implementations
impl<T: Add<Output = T>> Add<V2d<T>> for V2d<T>
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: Self) -> Self::Output
[src]
impl<T: AddAssign> AddAssign<V2d<T>> for V2d<T>
[src]
fn add_assign(&mut self, other: Self)
[src]
impl<T: Clone> Clone for V2d<T>
[src]
impl<T: Copy> Copy for V2d<T>
[src]
impl<T: Debug> Debug for V2d<T>
[src]
impl<T: Default> Default for V2d<T>
[src]
impl<T: Display + Debug> Display for V2d<T>
[src]
impl<T: Div<Output = T>> Div<V2d<T>> for V2d<T>
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, other: Self) -> Self::Output
[src]
impl<T: DivAssign> DivAssign<V2d<T>> for V2d<T>
[src]
fn div_assign(&mut self, other: Self)
[src]
impl<T> From<(T, T)> for V2d<T>
[src]
impl<T: Mul<Output = T>> Mul<V2d<T>> for V2d<T>
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, other: Self) -> Self::Output
[src]
impl<T: MulAssign> MulAssign<V2d<T>> for V2d<T>
[src]
fn mul_assign(&mut self, other: Self)
[src]
impl<T: PartialEq> PartialEq<V2d<T>> for V2d<T>
[src]
impl<T> StructuralPartialEq for V2d<T>
[src]
impl<T: Sub<Output = T>> Sub<V2d<T>> for V2d<T>
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: Self) -> Self::Output
[src]
impl<T: SubAssign> SubAssign<V2d<T>> for V2d<T>
[src]
fn sub_assign(&mut self, other: Self)
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for V2d<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for V2d<T> where
T: Send,
T: Send,
impl<T> Sync for V2d<T> where
T: Sync,
T: Sync,
impl<T> Unpin for V2d<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for V2d<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> 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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,