pub struct Vector<const P: usize, const Q: usize, const R: usize> {
pub mv: Multivector<P, Q, R>,
}Expand description
Vector type - wrapper around Multivector with only grade 1
Fields§
§mv: Multivector<P, Q, R>Implementations§
Source§impl<const P: usize, const Q: usize, const R: usize> Vector<P, Q, R>
impl<const P: usize, const Q: usize, const R: usize> Vector<P, Q, R>
pub fn from_components(x: f64, y: f64, z: f64) -> Self
pub fn e1() -> Self
pub fn e2() -> Self
pub fn e3() -> Self
pub fn from_multivector(mv: &Multivector<P, Q, R>) -> Self
pub fn geometric_product(&self, other: &Self) -> Multivector<P, Q, R>
pub fn geometric_product_with_multivector( &self, other: &Multivector<P, Q, R>, ) -> Multivector<P, Q, R>
pub fn geometric_product_with_bivector( &self, other: &Bivector<P, Q, R>, ) -> Multivector<P, Q, R>
pub fn geometric_product_with_scalar( &self, other: &Scalar<P, Q, R>, ) -> Multivector<P, Q, R>
pub fn add(&self, other: &Self) -> Self
pub fn magnitude(&self) -> f64
pub fn as_slice(&self) -> &[f64]
Sourcepub fn inner_product(&self, other: &Self) -> Multivector<P, Q, R>
pub fn inner_product(&self, other: &Self) -> Multivector<P, Q, R>
Inner product with another vector
Sourcepub fn inner_product_with_mv(
&self,
other: &Multivector<P, Q, R>,
) -> Multivector<P, Q, R>
pub fn inner_product_with_mv( &self, other: &Multivector<P, Q, R>, ) -> Multivector<P, Q, R>
Inner product with a multivector
Sourcepub fn inner_product_with_bivector(
&self,
other: &Bivector<P, Q, R>,
) -> Multivector<P, Q, R>
pub fn inner_product_with_bivector( &self, other: &Bivector<P, Q, R>, ) -> Multivector<P, Q, R>
Inner product with a bivector
Sourcepub fn outer_product(&self, other: &Self) -> Multivector<P, Q, R>
pub fn outer_product(&self, other: &Self) -> Multivector<P, Q, R>
Outer product with another vector
Sourcepub fn outer_product_with_mv(
&self,
other: &Multivector<P, Q, R>,
) -> Multivector<P, Q, R>
pub fn outer_product_with_mv( &self, other: &Multivector<P, Q, R>, ) -> Multivector<P, Q, R>
Outer product with a multivector
Sourcepub fn outer_product_with_bivector(
&self,
other: &Bivector<P, Q, R>,
) -> Multivector<P, Q, R>
pub fn outer_product_with_bivector( &self, other: &Bivector<P, Q, R>, ) -> Multivector<P, Q, R>
Outer product with a bivector
Sourcepub fn left_contraction(
&self,
other: &Bivector<P, Q, R>,
) -> Multivector<P, Q, R>
pub fn left_contraction( &self, other: &Bivector<P, Q, R>, ) -> Multivector<P, Q, R>
Left contraction with bivector
Sourcepub fn norm_squared(&self) -> f64
pub fn norm_squared(&self) -> f64
Compute the squared norm of the vector
Sourcepub fn reverse(&self) -> Self
pub fn reverse(&self) -> Self
Compute the reverse (for vectors, this is the same as the original)
Sourcepub fn norm(&self) -> f64
pub fn norm(&self) -> f64
Compute the norm (magnitude) of the vector
Note: This method is maintained for backward compatibility.
New code should prefer magnitude() for clarity.
Sourcepub fn hodge_dual(&self) -> Bivector<P, Q, R>
pub fn hodge_dual(&self) -> Bivector<P, Q, R>
Hodge dual of the vector Maps vectors to bivectors in 3D space
Trait Implementations§
impl<const P: usize, const Q: usize, const R: usize> StructuralPartialEq for Vector<P, Q, R>
Auto Trait Implementations§
impl<const P: usize, const Q: usize, const R: usize> Freeze for Vector<P, Q, R>
impl<const P: usize, const Q: usize, const R: usize> RefUnwindSafe for Vector<P, Q, R>
impl<const P: usize, const Q: usize, const R: usize> Send for Vector<P, Q, R>
impl<const P: usize, const Q: usize, const R: usize> Sync for Vector<P, Q, R>
impl<const P: usize, const Q: usize, const R: usize> Unpin for Vector<P, Q, R>
impl<const P: usize, const Q: usize, const R: usize> UnwindSafe for Vector<P, Q, R>
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