pub struct Vec2d<T> { /* private fields */ }Implementations§
Source§impl Vec2d<f32>
impl Vec2d<f32>
Sourcepub fn unit_vector(direction: f32) -> Self
pub fn unit_vector(direction: f32) -> Self
Creates a new unit vector in a specific direction
Sourcepub fn square_magnitude(&self) -> f32
pub fn square_magnitude(&self) -> f32
Returns the (non-sqrt) magnitude/length of the vector
pub fn clear(&mut self)
Source§impl Vec2d<f64>
impl Vec2d<f64>
Sourcepub fn unit_vector(direction: f64) -> Self
pub fn unit_vector(direction: f64) -> Self
Creates a new unit vector in a specific direction
Sourcepub fn square_magnitude(&self) -> f64
pub fn square_magnitude(&self) -> f64
Returns the (non-sqrt) magnitude/length of the vector
pub fn clear(&mut self)
Trait Implementations§
Source§impl<T: AddAssign> AddAssign for Vec2d<T>
Add Vec2d to this Vec2d
impl<T: AddAssign> AddAssign for Vec2d<T>
Add Vec2d to this Vec2d
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl AddAssign<&f32> for Vec2d<f32>
impl AddAssign<&f32> for Vec2d<f32>
Source§fn add_assign(&mut self, other: &f32)
fn add_assign(&mut self, other: &f32)
Performs the
+= operation. Read moreSource§impl AddAssign<&f64> for Vec2d<f64>
impl AddAssign<&f64> for Vec2d<f64>
Source§fn add_assign(&mut self, other: &f64)
fn add_assign(&mut self, other: &f64)
Performs the
+= operation. Read moreSource§impl AddAssign<&i8> for Vec2d<i8>
impl AddAssign<&i8> for Vec2d<i8>
Source§fn add_assign(&mut self, other: &i8)
fn add_assign(&mut self, other: &i8)
Performs the
+= operation. Read moreSource§impl AddAssign<&i16> for Vec2d<i16>
impl AddAssign<&i16> for Vec2d<i16>
Source§fn add_assign(&mut self, other: &i16)
fn add_assign(&mut self, other: &i16)
Performs the
+= operation. Read moreSource§impl AddAssign<&i32> for Vec2d<i32>
impl AddAssign<&i32> for Vec2d<i32>
Source§fn add_assign(&mut self, other: &i32)
fn add_assign(&mut self, other: &i32)
Performs the
+= operation. Read moreSource§impl AddAssign<&i64> for Vec2d<i64>
impl AddAssign<&i64> for Vec2d<i64>
Source§fn add_assign(&mut self, other: &i64)
fn add_assign(&mut self, other: &i64)
Performs the
+= operation. Read moreSource§impl AddAssign<&i128> for Vec2d<i128>
impl AddAssign<&i128> for Vec2d<i128>
Source§fn add_assign(&mut self, other: &i128)
fn add_assign(&mut self, other: &i128)
Performs the
+= operation. Read moreSource§impl AddAssign<&isize> for Vec2d<isize>
impl AddAssign<&isize> for Vec2d<isize>
Source§fn add_assign(&mut self, other: &isize)
fn add_assign(&mut self, other: &isize)
Performs the
+= operation. Read moreSource§impl AddAssign<&u8> for Vec2d<u8>
impl AddAssign<&u8> for Vec2d<u8>
Source§fn add_assign(&mut self, other: &u8)
fn add_assign(&mut self, other: &u8)
Performs the
+= operation. Read moreSource§impl AddAssign<&u16> for Vec2d<u16>
impl AddAssign<&u16> for Vec2d<u16>
Source§fn add_assign(&mut self, other: &u16)
fn add_assign(&mut self, other: &u16)
Performs the
+= operation. Read moreSource§impl AddAssign<&u32> for Vec2d<u32>
impl AddAssign<&u32> for Vec2d<u32>
Source§fn add_assign(&mut self, other: &u32)
fn add_assign(&mut self, other: &u32)
Performs the
+= operation. Read moreSource§impl AddAssign<&u64> for Vec2d<u64>
impl AddAssign<&u64> for Vec2d<u64>
Source§fn add_assign(&mut self, other: &u64)
fn add_assign(&mut self, other: &u64)
Performs the
+= operation. Read moreSource§impl AddAssign<&u128> for Vec2d<u128>
impl AddAssign<&u128> for Vec2d<u128>
Source§fn add_assign(&mut self, other: &u128)
fn add_assign(&mut self, other: &u128)
Performs the
+= operation. Read moreSource§impl AddAssign<&usize> for Vec2d<usize>
impl AddAssign<&usize> for Vec2d<usize>
Source§fn add_assign(&mut self, other: &usize)
fn add_assign(&mut self, other: &usize)
Performs the
+= operation. Read moreSource§impl<T: AddAssign + Copy> AddAssign<T> for Vec2d<T>
Add scalar to this Vec2d
impl<T: AddAssign + Copy> AddAssign<T> for Vec2d<T>
Add scalar to this Vec2d
Source§fn add_assign(&mut self, rhs: T)
fn add_assign(&mut self, rhs: T)
Performs the
+= operation. Read moreimpl<T: Copy> Copy for Vec2d<T>
Source§impl<T: DivAssign> DivAssign for Vec2d<T>
Divide this Vec2d by a Vec2d
impl<T: DivAssign> DivAssign for Vec2d<T>
Divide this Vec2d by a Vec2d
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/= operation. Read moreSource§impl DivAssign<&f32> for Vec2d<f32>
impl DivAssign<&f32> for Vec2d<f32>
Source§fn div_assign(&mut self, other: &f32)
fn div_assign(&mut self, other: &f32)
Performs the
/= operation. Read moreSource§impl DivAssign<&f64> for Vec2d<f64>
impl DivAssign<&f64> for Vec2d<f64>
Source§fn div_assign(&mut self, other: &f64)
fn div_assign(&mut self, other: &f64)
Performs the
/= operation. Read moreSource§impl DivAssign<&i8> for Vec2d<i8>
impl DivAssign<&i8> for Vec2d<i8>
Source§fn div_assign(&mut self, other: &i8)
fn div_assign(&mut self, other: &i8)
Performs the
/= operation. Read moreSource§impl DivAssign<&i16> for Vec2d<i16>
impl DivAssign<&i16> for Vec2d<i16>
Source§fn div_assign(&mut self, other: &i16)
fn div_assign(&mut self, other: &i16)
Performs the
/= operation. Read moreSource§impl DivAssign<&i32> for Vec2d<i32>
impl DivAssign<&i32> for Vec2d<i32>
Source§fn div_assign(&mut self, other: &i32)
fn div_assign(&mut self, other: &i32)
Performs the
/= operation. Read moreSource§impl DivAssign<&i64> for Vec2d<i64>
impl DivAssign<&i64> for Vec2d<i64>
Source§fn div_assign(&mut self, other: &i64)
fn div_assign(&mut self, other: &i64)
Performs the
/= operation. Read moreSource§impl DivAssign<&i128> for Vec2d<i128>
impl DivAssign<&i128> for Vec2d<i128>
Source§fn div_assign(&mut self, other: &i128)
fn div_assign(&mut self, other: &i128)
Performs the
/= operation. Read moreSource§impl DivAssign<&isize> for Vec2d<isize>
impl DivAssign<&isize> for Vec2d<isize>
Source§fn div_assign(&mut self, other: &isize)
fn div_assign(&mut self, other: &isize)
Performs the
/= operation. Read moreSource§impl DivAssign<&u8> for Vec2d<u8>
impl DivAssign<&u8> for Vec2d<u8>
Source§fn div_assign(&mut self, other: &u8)
fn div_assign(&mut self, other: &u8)
Performs the
/= operation. Read moreSource§impl DivAssign<&u16> for Vec2d<u16>
impl DivAssign<&u16> for Vec2d<u16>
Source§fn div_assign(&mut self, other: &u16)
fn div_assign(&mut self, other: &u16)
Performs the
/= operation. Read moreSource§impl DivAssign<&u32> for Vec2d<u32>
impl DivAssign<&u32> for Vec2d<u32>
Source§fn div_assign(&mut self, other: &u32)
fn div_assign(&mut self, other: &u32)
Performs the
/= operation. Read moreSource§impl DivAssign<&u64> for Vec2d<u64>
impl DivAssign<&u64> for Vec2d<u64>
Source§fn div_assign(&mut self, other: &u64)
fn div_assign(&mut self, other: &u64)
Performs the
/= operation. Read moreSource§impl DivAssign<&u128> for Vec2d<u128>
impl DivAssign<&u128> for Vec2d<u128>
Source§fn div_assign(&mut self, other: &u128)
fn div_assign(&mut self, other: &u128)
Performs the
/= operation. Read moreSource§impl DivAssign<&usize> for Vec2d<usize>
impl DivAssign<&usize> for Vec2d<usize>
Source§fn div_assign(&mut self, other: &usize)
fn div_assign(&mut self, other: &usize)
Performs the
/= operation. Read moreSource§impl<T: DivAssign + Copy> DivAssign<T> for Vec2d<T>
Divide this Vec2d by scalar
impl<T: DivAssign + Copy> DivAssign<T> for Vec2d<T>
Divide this Vec2d by scalar
Source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
Performs the
/= operation. Read moreimpl<T: Eq> Eq for Vec2d<T>
Source§impl<T: Mul + Add> Mul for Vec2d<T>
Calculate and return the scalar product of this Vec2d by Vec2d
impl<T: Mul + Add> Mul for Vec2d<T>
Calculate and return the scalar product of this Vec2d by Vec2d
Source§impl<T: MulAssign> MulAssign for Vec2d<T>
Multiply this Vec2d by a Vec2d
impl<T: MulAssign> MulAssign for Vec2d<T>
Multiply this Vec2d by a Vec2d
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*= operation. Read moreSource§impl MulAssign<&f32> for Vec2d<f32>
impl MulAssign<&f32> for Vec2d<f32>
Source§fn mul_assign(&mut self, other: &f32)
fn mul_assign(&mut self, other: &f32)
Performs the
*= operation. Read moreSource§impl MulAssign<&f64> for Vec2d<f64>
impl MulAssign<&f64> for Vec2d<f64>
Source§fn mul_assign(&mut self, other: &f64)
fn mul_assign(&mut self, other: &f64)
Performs the
*= operation. Read moreSource§impl MulAssign<&i8> for Vec2d<i8>
impl MulAssign<&i8> for Vec2d<i8>
Source§fn mul_assign(&mut self, other: &i8)
fn mul_assign(&mut self, other: &i8)
Performs the
*= operation. Read moreSource§impl MulAssign<&i16> for Vec2d<i16>
impl MulAssign<&i16> for Vec2d<i16>
Source§fn mul_assign(&mut self, other: &i16)
fn mul_assign(&mut self, other: &i16)
Performs the
*= operation. Read moreSource§impl MulAssign<&i32> for Vec2d<i32>
impl MulAssign<&i32> for Vec2d<i32>
Source§fn mul_assign(&mut self, other: &i32)
fn mul_assign(&mut self, other: &i32)
Performs the
*= operation. Read moreSource§impl MulAssign<&i64> for Vec2d<i64>
impl MulAssign<&i64> for Vec2d<i64>
Source§fn mul_assign(&mut self, other: &i64)
fn mul_assign(&mut self, other: &i64)
Performs the
*= operation. Read moreSource§impl MulAssign<&i128> for Vec2d<i128>
impl MulAssign<&i128> for Vec2d<i128>
Source§fn mul_assign(&mut self, other: &i128)
fn mul_assign(&mut self, other: &i128)
Performs the
*= operation. Read moreSource§impl MulAssign<&isize> for Vec2d<isize>
impl MulAssign<&isize> for Vec2d<isize>
Source§fn mul_assign(&mut self, other: &isize)
fn mul_assign(&mut self, other: &isize)
Performs the
*= operation. Read moreSource§impl MulAssign<&u8> for Vec2d<u8>
impl MulAssign<&u8> for Vec2d<u8>
Source§fn mul_assign(&mut self, other: &u8)
fn mul_assign(&mut self, other: &u8)
Performs the
*= operation. Read moreSource§impl MulAssign<&u16> for Vec2d<u16>
impl MulAssign<&u16> for Vec2d<u16>
Source§fn mul_assign(&mut self, other: &u16)
fn mul_assign(&mut self, other: &u16)
Performs the
*= operation. Read moreSource§impl MulAssign<&u32> for Vec2d<u32>
impl MulAssign<&u32> for Vec2d<u32>
Source§fn mul_assign(&mut self, other: &u32)
fn mul_assign(&mut self, other: &u32)
Performs the
*= operation. Read moreSource§impl MulAssign<&u64> for Vec2d<u64>
impl MulAssign<&u64> for Vec2d<u64>
Source§fn mul_assign(&mut self, other: &u64)
fn mul_assign(&mut self, other: &u64)
Performs the
*= operation. Read moreSource§impl MulAssign<&u128> for Vec2d<u128>
impl MulAssign<&u128> for Vec2d<u128>
Source§fn mul_assign(&mut self, other: &u128)
fn mul_assign(&mut self, other: &u128)
Performs the
*= operation. Read moreSource§impl MulAssign<&usize> for Vec2d<usize>
impl MulAssign<&usize> for Vec2d<usize>
Source§fn mul_assign(&mut self, other: &usize)
fn mul_assign(&mut self, other: &usize)
Performs the
*= operation. Read moreSource§impl<T: MulAssign + Copy> MulAssign<T> for Vec2d<T>
Multiply this Vec2d by scalar
impl<T: MulAssign + Copy> MulAssign<T> for Vec2d<T>
Multiply this Vec2d by scalar
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*= operation. Read moreSource§impl<T: PartialOrd> PartialOrd for Vec2d<T>
impl<T: PartialOrd> PartialOrd for Vec2d<T>
impl<T: PartialEq> StructuralPartialEq for Vec2d<T>
Source§impl<T: SubAssign> SubAssign for Vec2d<T>
Subtract Vec2d from this Vec2d
impl<T: SubAssign> SubAssign for Vec2d<T>
Subtract Vec2d from this Vec2d
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreSource§impl SubAssign<&f32> for Vec2d<f32>
impl SubAssign<&f32> for Vec2d<f32>
Source§fn sub_assign(&mut self, other: &f32)
fn sub_assign(&mut self, other: &f32)
Performs the
-= operation. Read moreSource§impl SubAssign<&f64> for Vec2d<f64>
impl SubAssign<&f64> for Vec2d<f64>
Source§fn sub_assign(&mut self, other: &f64)
fn sub_assign(&mut self, other: &f64)
Performs the
-= operation. Read moreSource§impl SubAssign<&i8> for Vec2d<i8>
impl SubAssign<&i8> for Vec2d<i8>
Source§fn sub_assign(&mut self, other: &i8)
fn sub_assign(&mut self, other: &i8)
Performs the
-= operation. Read moreSource§impl SubAssign<&i16> for Vec2d<i16>
impl SubAssign<&i16> for Vec2d<i16>
Source§fn sub_assign(&mut self, other: &i16)
fn sub_assign(&mut self, other: &i16)
Performs the
-= operation. Read moreSource§impl SubAssign<&i32> for Vec2d<i32>
impl SubAssign<&i32> for Vec2d<i32>
Source§fn sub_assign(&mut self, other: &i32)
fn sub_assign(&mut self, other: &i32)
Performs the
-= operation. Read moreSource§impl SubAssign<&i64> for Vec2d<i64>
impl SubAssign<&i64> for Vec2d<i64>
Source§fn sub_assign(&mut self, other: &i64)
fn sub_assign(&mut self, other: &i64)
Performs the
-= operation. Read moreSource§impl SubAssign<&i128> for Vec2d<i128>
impl SubAssign<&i128> for Vec2d<i128>
Source§fn sub_assign(&mut self, other: &i128)
fn sub_assign(&mut self, other: &i128)
Performs the
-= operation. Read moreSource§impl SubAssign<&isize> for Vec2d<isize>
impl SubAssign<&isize> for Vec2d<isize>
Source§fn sub_assign(&mut self, other: &isize)
fn sub_assign(&mut self, other: &isize)
Performs the
-= operation. Read moreSource§impl SubAssign<&u8> for Vec2d<u8>
impl SubAssign<&u8> for Vec2d<u8>
Source§fn sub_assign(&mut self, other: &u8)
fn sub_assign(&mut self, other: &u8)
Performs the
-= operation. Read moreSource§impl SubAssign<&u16> for Vec2d<u16>
impl SubAssign<&u16> for Vec2d<u16>
Source§fn sub_assign(&mut self, other: &u16)
fn sub_assign(&mut self, other: &u16)
Performs the
-= operation. Read moreSource§impl SubAssign<&u32> for Vec2d<u32>
impl SubAssign<&u32> for Vec2d<u32>
Source§fn sub_assign(&mut self, other: &u32)
fn sub_assign(&mut self, other: &u32)
Performs the
-= operation. Read moreSource§impl SubAssign<&u64> for Vec2d<u64>
impl SubAssign<&u64> for Vec2d<u64>
Source§fn sub_assign(&mut self, other: &u64)
fn sub_assign(&mut self, other: &u64)
Performs the
-= operation. Read moreSource§impl SubAssign<&u128> for Vec2d<u128>
impl SubAssign<&u128> for Vec2d<u128>
Source§fn sub_assign(&mut self, other: &u128)
fn sub_assign(&mut self, other: &u128)
Performs the
-= operation. Read moreAuto Trait Implementations§
impl<T> Freeze for Vec2d<T>where
T: Freeze,
impl<T> RefUnwindSafe for Vec2d<T>where
T: RefUnwindSafe,
impl<T> Send for Vec2d<T>where
T: Send,
impl<T> Sync for Vec2d<T>where
T: Sync,
impl<T> Unpin for Vec2d<T>where
T: Unpin,
impl<T> UnsafeUnpin for Vec2d<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Vec2d<T>where
T: UnwindSafe,
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