[−][src]Struct footile::Pt
2-dimensional vector / point.
Implementations
impl Pt
[src]
pub fn x(self) -> f32
[src]
Get the X value
pub fn y(self) -> f32
[src]
Get the Y value
pub fn mag(self) -> f32
[src]
Get the magnitude of a vector
pub fn normalize(self) -> Self
[src]
Create a copy normalized to unit length
pub fn dist_sq(self, rhs: Self) -> f32
[src]
Calculate the distance squared between two points
pub fn dist(self, rhs: Self) -> f32
[src]
Calculate the distance between two points
pub fn midpoint(self, rhs: Self) -> Self
[src]
Get the midpoint of two points
pub fn left(self) -> Self
[src]
Create a left-hand perpendicular vector
pub fn right(self) -> Self
[src]
Create a right-hand perpendicular vector
pub fn lerp(self, rhs: Self, t: f32) -> Self
[src]
Calculate linear interpolation of two points.
t
Interpolation amount, from 0 to 1
pub fn angle_rel(self, rhs: Self) -> f32
[src]
Calculate the relative angle to another vector / point.
The result will be between -PI
and +PI
.
Trait Implementations
impl Add<Pt> for Pt
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self
[src]
impl Clone for Pt
[src]
impl Copy for Pt
[src]
impl Debug for Pt
[src]
impl Default for Pt
[src]
impl Div<f32> for Pt
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, s: f32) -> Self
[src]
impl Mul<Pt> for Pt
[src]
type Output = f32
The resulting type after applying the *
operator.
fn mul(self, rhs: Self) -> f32
[src]
Calculate the cross product of two vectors
impl Mul<Pt> for Transform
[src]
impl Mul<f32> for Pt
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, s: f32) -> Self
[src]
impl Neg for Pt
[src]
impl PartialEq<Pt> for Pt
[src]
impl StructuralPartialEq for Pt
[src]
impl Sub<Pt> for Pt
[src]
Auto Trait Implementations
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, 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>,