pub struct Norm2D { /* private fields */ }
Expand description
Norm2D, a normalized vector within 2D space
Trait Implementations§
Source§impl Is2D for Norm2D
impl Is2D for Norm2D
Source§fn abs(&self) -> NonNegative
fn abs(&self) -> NonNegative
The absolute / length of this position
Source§impl IsND for Norm2D
impl IsND for Norm2D
Source§fn n_dimensions() -> usize
fn n_dimensions() -> usize
Should return the number of dimensions. E.g. 2 for points in 2D space, 3 for points in 3D space etc.
Source§impl IsNormalized2D for Norm2D
impl IsNormalized2D for Norm2D
Source§fn new<P>(p: P) -> Result<Self>where
P: Is2D,
fn new<P>(p: P) -> Result<Self>where
P: Is2D,
Should construct a new object and only fail if it can’t be normalized
Source§fn norm_x() -> Self
fn norm_x() -> Self
Returns a new normalized object which only points in the positive x-Direction
Source§fn norm_y() -> Self
fn norm_y() -> Self
Returns a new normalized object which only points in the positive y-Direction
Source§fn norm_x_neg() -> Self
fn norm_x_neg() -> Self
Returns a new normalized object which only points in the negative x-Direction
Source§fn norm_y_neg() -> Self
fn norm_y_neg() -> Self
Returns a new normalized object which only points in the negative y-Direction
Source§impl Ord for Norm2D
impl Ord for Norm2D
Source§impl PartialOrd for Norm2D
impl PartialOrd for Norm2D
impl Eq for Norm2D
impl StructuralPartialEq for Norm2D
Auto Trait Implementations§
impl Freeze for Norm2D
impl RefUnwindSafe for Norm2D
impl Send for Norm2D
impl Sync for Norm2D
impl Unpin for Norm2D
impl UnwindSafe for Norm2D
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