[−][src]Struct pointy::Pt32
2-dimensional point / vector with f32
values.
use pointy::Pt32; let pt = Pt32(10.0, 15.0);
Implementations
impl Pt32
[src]
pub const fn x(self) -> f32
[src]
Get the X value
pub const fn y(self) -> f32
[src]
Get the Y value
pub fn mag(self) -> f32
[src]
Get the magnitude (length) of a vector
pub fn normalize(self) -> Self
[src]
Normalize to unit length vector
pub fn dist_sq<P: Into<Self>>(self, rhs: P) -> f32
[src]
Get distance squared between two points
pub fn dist<P: Into<Self>>(self, rhs: P) -> f32
[src]
Get distance between two points
pub fn midpoint<P: Into<Self>>(self, rhs: P) -> Self
[src]
Get the midpoint of two points
pub fn lerp<P: Into<Self>>(self, rhs: P, t: f32) -> Self
[src]
Calculate linear interpolation of two points.
t
Interpolation amount, from 0 to 1
pub fn left(self) -> Self
[src]
Get left-hand perpendicular vector
pub fn right(self) -> Self
[src]
Get right-hand perpendicular vector
pub fn dot<P: Into<Self>>(self, rhs: P) -> f32
[src]
Get dot product with another vector
pub fn angle(self) -> f32
[src]
Get vector angle in radians
pub fn angle_rel<P: Into<Self>>(self, rhs: P) -> f32
[src]
Get relative angle to another vector.
The result will be between -PI
and +PI
.
Trait Implementations
impl Add<(f32, f32)> for Pt32
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: (f32, f32)) -> Self
[src]
impl Add<Pt32> for Pt32
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self
[src]
impl Clone for Pt32
[src]
impl Copy for Pt32
[src]
impl Debug for Pt32
[src]
impl Default for Pt32
[src]
impl Div<f32> for Pt32
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, s: f32) -> Self
[src]
impl From<(f32, f32)> for Pt32
[src]
impl Mul<(f32, f32)> for Pt32
[src]
type Output = f32
The resulting type after applying the *
operator.
fn mul(self, rhs: (f32, f32)) -> f32
[src]
Get cross product with another vector.
Returns the signed magnitude of the 3D cross product.
impl Mul<Pt32> for Pt32
[src]
type Output = f32
The resulting type after applying the *
operator.
fn mul(self, rhs: Self) -> f32
[src]
Get cross product with another vector.
Returns the signed magnitude of the 3D cross product.
impl Mul<Pt32> for Transform32
[src]
type Output = Pt32
The resulting type after applying the *
operator.
fn mul(self, s: Pt32) -> Pt32
[src]
impl Mul<Transform32> for Pt32
[src]
type Output = Pt32
The resulting type after applying the *
operator.
fn mul(self, t: Transform32) -> Pt32
[src]
impl Mul<f32> for Pt32
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, s: f32) -> Self
[src]
impl Neg for Pt32
[src]
impl PartialEq<Pt32> for Pt32
[src]
impl StructuralPartialEq for Pt32
[src]
impl Sub<(f32, f32)> for Pt32
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: (f32, f32)) -> Self
[src]
impl Sub<Pt32> for Pt32
[src]
Auto Trait Implementations
impl RefUnwindSafe for Pt32
impl Send for Pt32
impl Sync for Pt32
impl Unpin for Pt32
impl UnwindSafe for Pt32
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>,