[−][src]Struct mvt::Vec2
2-dimensional vector / point.
Fields
x: f64
y: f64
Methods
impl Vec2
[src]
pub fn new(x: f64, y: f64) -> Self
[src]
Create a new Vec2
pub fn zero() -> Self
[src]
Create a zero Vec2
pub fn mag(self) -> f64
[src]
Get the magnitude of a Vec2
pub fn normalize(self) -> Self
[src]
Create a copy normalized to unit length
pub fn dist_sq(self, other: Self) -> f64
[src]
Calculate the distance squared between two Vec2
pub fn dist(self, other: Self) -> f64
[src]
Calculate the distance between two Vec2
Trait Implementations
impl Clone for Vec2
[src]
fn clone(&self) -> Vec2
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for Vec2
[src]
impl PartialEq<Vec2> for Vec2
[src]
impl Add<Vec2> for Vec2
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: Self) -> Self
[src]
impl Sub<Vec2> for Vec2
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: Self) -> Self
[src]
impl Mul<f64> for Vec2
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, s: f64) -> Self
[src]
impl Mul<Vec2> for Vec2
[src]
type Output = f64
The resulting type after applying the *
operator.
fn mul(self, other: Self) -> f64
[src]
Calculate the cross product of two Vec2
impl Mul<Vec2> for Transform
[src]
type Output = Vec2
The resulting type after applying the *
operator.
fn mul(self, s: Vec2) -> Vec2
[src]
impl Div<f64> for Vec2
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, s: f64) -> Self
[src]
impl Neg for Vec2
[src]
impl Debug for Vec2
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,