pub struct V2 {
pub x: f32,
pub y: f32,
}Fields§
§x: f32§y: f32Implementations§
Source§impl V2
impl V2
pub const X: V2
pub const Y: V2
pub const LEFT: V2
pub const DOWN: V2
pub const RIGHT: V2
pub const UP: V2
pub const ZERO: V2
pub fn dot(self, b: V2) -> f32
pub fn sq(self) -> f32
pub fn mag(self: V2) -> f32
pub fn abs(v: V2) -> V2
pub fn aspect(v: V2) -> f32
pub fn normalize(self) -> V2
pub fn perp2(v: V2) -> V2
pub fn zeroish(self: V2) -> bool
pub fn nearly(a: V2, b: V2) -> bool
Trait Implementations§
impl Copy for V2
Auto Trait Implementations§
impl Freeze for V2
impl RefUnwindSafe for V2
impl Send for V2
impl Sync for V2
impl Unpin for V2
impl UnwindSafe for V2
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more