Bivector

Struct Bivector 

Source
pub struct Bivector<T> {
    pub xy: T,
    pub xz: T,
    pub yz: T,
}
Expand description

The 3D bivector type.

Fields§

§xy: T

The component representing the xy plane.

§xz: T

The component representing the xz plane.

§yz: T

The component representing the yz plane.

Implementations§

Source§

impl<T> Bivector<T>

Source

pub fn new(xy: T, xz: T, yz: T) -> Self

Creates a new bivector from its components.

Source§

impl<T: Real> Bivector<T>

Source

pub fn exp(self) -> Rotor<T>

Returns the exponent of the bivector as a rotor.

Source§

impl<T: Zero> Bivector<T>

Source

pub fn xy(xy: T) -> Self

Creates a new bivector along the xy plane.

Source

pub fn xz(xz: T) -> Self

Creates a new bivector along the xz plane.

Source

pub fn yz(yz: T) -> Self

Creates a new bivector along the yz plane.

Trait Implementations§

Source§

impl<T> Add for Bivector<T>
where T: Add<Output = T>,

Source§

type Output = Bivector<T>

The resulting type after applying the + operator.
Source§

fn add(self, __rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl<T> AddAssign for Bivector<T>
where T: AddAssign,

Source§

fn add_assign(&mut self, __rhs: Self)

Performs the += operation. Read more
Source§

impl<T: Clone> Clone for Bivector<T>

Source§

fn clone(&self) -> Bivector<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for Bivector<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> Div<T> for Bivector<T>
where T: Div<Output = T> + Copy,

Source§

type Output = Bivector<T>

The resulting type after applying the / operator.
Source§

fn div(self, other: T) -> Self

Performs the / operation. Read more
Source§

impl<T> DivAssign<T> for Bivector<T>
where T: DivAssign + Copy,

Source§

fn div_assign(&mut self, other: T)

Performs the /= operation. Read more
Source§

impl<T: Real> DotProduct<Bivector<T>> for Rotor<T>

Source§

type Output = Rotor<T>

The output type of the dot product.
Source§

fn dot(&self, other: &Bivector<T>) -> Self

The dot product.
Source§

impl<T: Real> DotProduct<Bivector<T>> for Vector<T>

Source§

type Output = Vector<T>

The output type of the dot product.
Source§

fn dot(&self, other: &Bivector<T>) -> Self

The dot product.
Source§

impl<T: Real> DotProduct<Rotor<T>> for Bivector<T>

Source§

type Output = Rotor<T>

The output type of the dot product.
Source§

fn dot(&self, other: &Rotor<T>) -> Rotor<T>

The dot product.
Source§

impl<T: Real> DotProduct<Vector<T>> for Bivector<T>

Source§

type Output = Vector<T>

The output type of the dot product.
Source§

fn dot(&self, other: &Vector<T>) -> Vector<T>

The dot product.
Source§

impl<T: Real> DotProduct for Bivector<T>

Source§

type Output = <Bivector<T> as VectorSpace>::Scalar

The output type of the dot product.
Source§

fn dot(&self, other: &Self) -> T

The dot product.
Source§

impl<T> Mul<T> for Bivector<T>
where T: Mul<Output = T> + Copy,

Source§

type Output = Bivector<T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: T) -> Self

Performs the * operation. Read more
Source§

impl<T> MulAssign<T> for Bivector<T>
where T: MulAssign + Copy,

Source§

fn mul_assign(&mut self, other: T)

Performs the *= operation. Read more
Source§

impl<T: Neg<Output = T>> Neg for Bivector<T>

Source§

type Output = Bivector<T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Bivector<T>

Performs the unary - operation. Read more
Source§

impl<T: PartialEq> PartialEq for Bivector<T>

Source§

fn eq(&self, other: &Bivector<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> Sub for Bivector<T>
where T: Sub<Output = T>,

Source§

type Output = Bivector<T>

The resulting type after applying the - operator.
Source§

fn sub(self, __rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl<T> SubAssign for Bivector<T>
where T: SubAssign,

Source§

fn sub_assign(&mut self, __rhs: Self)

Performs the -= operation. Read more
Source§

impl<T: Real> VectorSpace for Bivector<T>

Source§

type Scalar = T

The scalar type of the vector space.
Source§

impl<T: Zero> Zero for Bivector<T>

Source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
Source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
Source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
Source§

impl<T: Copy> Copy for Bivector<T>

Source§

impl<T: Eq> Eq for Bivector<T>

Source§

impl<T> StructuralPartialEq for Bivector<T>

Auto Trait Implementations§

§

impl<T> Freeze for Bivector<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Bivector<T>
where T: RefUnwindSafe,

§

impl<T> Send for Bivector<T>
where T: Send,

§

impl<T> Sync for Bivector<T>
where T: Sync,

§

impl<T> Unpin for Bivector<T>
where T: Unpin,

§

impl<T> UnwindSafe for Bivector<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T, D> AffineSpace for T
where T: Sub<Output = D>, D: VectorSpace,

Source§

type Diff = D

The difference type.
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Bases for T
where T: VectorSpace,

Source§

fn unit_bases<const I: usize>() -> Self
where Self: Basis<I>,

Creates the specified unit basis of the vector space.
Source§

fn bases_of<const I: usize>(magnitude: Self::Scalar) -> Self
where Self: Basis<I>,

Creates the specified basis of the vector of the specified magnitude.
Source§

fn bases<const I: usize>(&self) -> Self::Scalar
where Self: Basis<I>,

Queries the specified basis of a vector space.
Source§

fn bases_mut<const I: usize>(&mut self) -> &mut Self::Scalar
where Self: Basis<I>,

Queries the specified basis of a vector space as a mutable reference.
Source§

fn with_bases<const I: usize>(self, magnitude: Self::Scalar) -> Self
where Self: Basis<I>,

Creates a new vector with the specified basis set to a different value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> InnerSpace for T
where T: DotProduct<Output = <T as VectorSpace>::Scalar>,

Source§

fn magnitude2(&self) -> Self::Scalar

The squared magnitude. Read more
Source§

fn magnitude(&self) -> Self::Scalar

The magnitude of a vector.
Source§

fn normalize(self) -> Self

The normalized vector.
Source§

fn angle(&self, other: &Self) -> Self::Scalar

The angle between two vectors.
Source§

fn with_magnitude(self, magnitude: Self::Scalar) -> Self

Sets the magnitude of a vector.
Source§

fn with_direction(self, dir: Self) -> Self

Sets the direction of a vector.
Source§

fn query_axis(&self, dir: Self) -> Self::Scalar

The value of the vector along the specified axis.
Source§

fn normalized_project(self, dir: Self) -> Self

Projects a vector onto an already normalized direction vector.
Source§

fn project(self, dir: Self) -> Self

Projects a vector onto the specified direction vector.
Source§

fn normalized_reject(self, dir: Self) -> Self

Rejects a vector from an already normalized direction vector.
Source§

fn reject(self, dir: Self) -> Self

Rejects a vector from the specified direction vector.
Source§

fn normalized_reflect(self, dir: Self) -> Self

Reflects a vector from an already normalized direction vector.
Source§

fn reflect(self, dir: Self) -> Self

Reflects a vector from the specified direction vector.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> VectorSpaceAssign for T