pub struct Vector3<T: PhysicsQuantity> {
pub data: [T; 3],
}Fields§
§data: [T; 3]Implementations§
Source§impl<T: PhysicsQuantity> Vector3<T>
impl<T: PhysicsQuantity> Vector3<T>
pub fn from_ndarray(array: ArrayView1<'_, T>) -> Result<Self, String>
Source§impl<T: PhysicsQuantity> Vector3<T>
impl<T: PhysicsQuantity> Vector3<T>
pub fn new(data: [T; 3]) -> Self
pub fn zero() -> Self
pub fn data(&self) -> [T; 3]
pub fn from_f64(data: [f64; 3]) -> Self
pub fn to_ndarray(&self) -> Array1<T>
pub fn norm(&self) -> T
pub fn to_unit_vector(&self) -> Vector3<f64>
pub fn to_raw(&self) -> Vector3<f64>
👎Deprecated since 0.2.9: please use
as_f64() insteadpub fn as_f64(&self) -> Vector3<f64>
pub fn from_raw(raw: Vector3<f64>) -> Self
pub fn optimize(&mut self)
Source§impl<T: PhysicsQuantity> Vector3<T>
impl<T: PhysicsQuantity> Vector3<T>
Trait Implementations§
Source§impl<T: PhysicsQuantity> Add for Vector3<T>
impl<T: PhysicsQuantity> Add for Vector3<T>
Source§impl<T: PhysicsQuantity> AddAssign for Vector3<T>
impl<T: PhysicsQuantity> AddAssign for Vector3<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 Vector3<T>
impl<T: PhysicsQuantity> DivAssign<f64> for Vector3<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<Vector3<U>> for Matrix2x3<T>where
T: PhysicsQuantity + Mul<U, Output = V>,
U: PhysicsQuantity,
V: PhysicsQuantity + Add<Output = V>,
impl<T, U, V> Mul<Vector3<U>> for Matrix2x3<T>where
T: PhysicsQuantity + Mul<U, Output = V>,
U: PhysicsQuantity,
V: PhysicsQuantity + Add<Output = V>,
Source§impl<T: PhysicsQuantity> MulAssign<f64> for Vector3<T>
impl<T: PhysicsQuantity> MulAssign<f64> for Vector3<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 Vector3<T>
impl<T: PhysicsQuantity> Sub for Vector3<T>
Source§impl<T: PhysicsQuantity> SubAssign for Vector3<T>
impl<T: PhysicsQuantity> SubAssign for Vector3<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 Vector3<T>
impl<T: PhysicsQuantity> StructuralPartialEq for Vector3<T>
Auto Trait Implementations§
impl<T> Freeze for Vector3<T>where
T: Freeze,
impl<T> RefUnwindSafe for Vector3<T>where
T: RefUnwindSafe,
impl<T> Send for Vector3<T>where
T: Send,
impl<T> Sync for Vector3<T>where
T: Sync,
impl<T> Unpin for Vector3<T>where
T: Unpin,
impl<T> UnwindSafe for Vector3<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