pub struct Vector2<T: PhysicsQuantity> {
pub data: [T; 2],
}Fields§
§data: [T; 2]Implementations§
Source§impl<T: PhysicsQuantity> Vector2<T>
impl<T: PhysicsQuantity> Vector2<T>
pub fn new(data: [T; 2]) -> Self
pub fn zero() -> Self
pub fn data(&self) -> [T; 2]
pub fn from_f64(data: [f64; 2]) -> Self
pub fn to_ndarray(&self) -> Array1<T>
pub fn from_ndarray(array: ArrayView1<'_, T>) -> Result<Self, String>
pub fn norm(&self) -> T
pub fn abs(&self) -> Self
pub fn to_unit_vector(&self) -> Vector2<f64>
pub fn as_f64(&self) -> Vector2<f64>
pub fn from_raw(raw: Vector2<f64>) -> Self
pub fn optimize(&mut self)
pub fn dot_vct<U, V>(&self, other: &Vector2<U>) -> V
Trait Implementations§
Source§impl<T: PhysicsQuantity> Add for Vector2<T>
impl<T: PhysicsQuantity> Add for Vector2<T>
Source§impl<T: PhysicsQuantity> AddAssign for Vector2<T>
impl<T: PhysicsQuantity> AddAssign for Vector2<T>
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+= operation. Read moreSource§impl<T: PhysicsQuantity> DivAssign<f64> for Vector2<T>
impl<T: PhysicsQuantity> DivAssign<f64> for Vector2<T>
Source§fn div_assign(&mut self, scalar: f64)
fn div_assign(&mut self, scalar: f64)
Performs the
/= operation. Read moreSource§impl<T, U, V> Mul<Vector2<U>> for Matrix3x2<T>where
T: PhysicsQuantity + Mul<U, Output = V>,
U: PhysicsQuantity,
V: PhysicsQuantity + Add<Output = V>,
impl<T, U, V> Mul<Vector2<U>> for Matrix3x2<T>where
T: PhysicsQuantity + Mul<U, Output = V>,
U: PhysicsQuantity,
V: PhysicsQuantity + Add<Output = V>,
Source§impl<T: PhysicsQuantity> MulAssign<f64> for Vector2<T>
impl<T: PhysicsQuantity> MulAssign<f64> for Vector2<T>
Source§fn mul_assign(&mut self, scalar: f64)
fn mul_assign(&mut self, scalar: f64)
Performs the
*= operation. Read moreSource§impl<T: PhysicsQuantity> Sub for Vector2<T>
impl<T: PhysicsQuantity> Sub for Vector2<T>
Source§impl<T: PhysicsQuantity> SubAssign for Vector2<T>
impl<T: PhysicsQuantity> SubAssign for Vector2<T>
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-= operation. Read moreimpl<T: Copy + PhysicsQuantity> Copy for Vector2<T>
impl<T: PhysicsQuantity> StructuralPartialEq for Vector2<T>
Auto Trait Implementations§
impl<T> Freeze for Vector2<T>where
T: Freeze,
impl<T> RefUnwindSafe for Vector2<T>where
T: RefUnwindSafe,
impl<T> Send for Vector2<T>where
T: Send,
impl<T> Sync for Vector2<T>where
T: Sync,
impl<T> Unpin for Vector2<T>where
T: Unpin,
impl<T> UnsafeUnpin for Vector2<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Vector2<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