pub struct Vector3<T> {
pub x: T,
pub y: T,
pub z: T,
}Expand description
A 3-component vector.
Fields§
§x: T§y: T§z: TImplementations§
Source§impl Vector3<f64>
impl Vector3<f64>
Sourcepub fn normalize(&self) -> Self
pub fn normalize(&self) -> Self
Normalise to unit length. Returns zero vector if norm is near zero.
Sourcepub fn outer(&self, rhs: &Self) -> Matrix3<f64>
pub fn outer(&self, rhs: &Self) -> Matrix3<f64>
Outer product (self * rhs^T), yielding a 3x3 matrix.
Sourcepub fn transpose(&self) -> TransposedVector3
pub fn transpose(&self) -> TransposedVector3
Return the 1x3 transpose as a TransposedVector3 for nalgebra-like
centered * world_centered.transpose() patterns producing a Matrix3.
Trait Implementations§
Source§impl AddAssign for Vector3<f64>
impl AddAssign for Vector3<f64>
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreimpl<T: Copy> Copy for Vector3<T>
Source§impl<'de, T> Deserialize<'de> for Vector3<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Vector3<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl DivAssign<f64> for Vector3<f64>
impl DivAssign<f64> for Vector3<f64>
Source§fn div_assign(&mut self, rhs: f64)
fn div_assign(&mut self, rhs: f64)
Performs the
/= operation. Read moreSource§impl Mul<TransposedVector3> for Vector3<f64>
Vector3 * TransposedVector3 → Matrix3 (outer product).
impl Mul<TransposedVector3> for Vector3<f64>
Vector3 * TransposedVector3 → Matrix3 (outer product).
Source§impl MulAssign<f64> for Vector3<f64>
impl MulAssign<f64> for Vector3<f64>
Source§fn mul_assign(&mut self, rhs: f64)
fn mul_assign(&mut self, rhs: f64)
Performs the
*= operation. Read moreSource§impl<T: PartialEq> PartialEq for Vector3<T>
impl<T: PartialEq> PartialEq for Vector3<T>
impl<T> 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> UnsafeUnpin for Vector3<T>where
T: UnsafeUnpin,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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