Struct vecmat::Quaternion [−][src]
#[repr(transparent)]pub struct Quaternion<T> { /* fields omitted */ }
Expand description
Quaternion.
Implementations
impl<T> Quaternion<T>
[src]
impl<T> Quaternion<T>
[src]pub fn new(w: T, x: T, y: T, z: T) -> Self
[src]
pub fn from_vector(vec: Vector4<T>) -> Self
[src]
pub fn from_array(arr: [T; 4]) -> Self
[src]
pub fn from_tuple(tup: (T, T, T, T)) -> Self
[src]
pub fn from_scalar_and_vector3(w: T, vec: Vector3<T>) -> Self
[src]
pub fn into_vector(self) -> Vector4<T>
[src]
pub fn into_array(self) -> [T; 4]
[src]
pub fn into_tuple(self) -> (T, T, T, T)
[src]
pub fn into_scalar_and_vector3(self) -> (T, Vector3<T>)
[src]
impl<T> Quaternion<T> where
T: Copy,
[src]
impl<T> Quaternion<T> where
T: Copy,
[src]impl<T> Quaternion<T>
[src]
impl<T> Quaternion<T>
[src]impl<T> Quaternion<T> where
T: Neg<Output = T> + Copy,
[src]
impl<T> Quaternion<T> where
T: Neg<Output = T> + Copy,
[src]pub fn into_matrix(self) -> Matrix4x4<T>
[src]
impl<T> Quaternion<T> where
T: Neg<Output = T>,
[src]
impl<T> Quaternion<T> where
T: Neg<Output = T>,
[src]impl<T> Quaternion<T> where
T: Zero + One,
[src]
impl<T> Quaternion<T> where
T: Zero + One,
[src]impl<T> Quaternion<T> where
T: Add<Output = T> + Mul<Output = T> + Copy,
[src]
impl<T> Quaternion<T> where
T: Add<Output = T> + Mul<Output = T> + Copy,
[src]impl<T: Float> Quaternion<T>
[src]
impl<T: Float> Quaternion<T>
[src]impl<T> Quaternion<T> where
T: Float,
[src]
impl<T> Quaternion<T> where
T: Float,
[src]Trait Implementations
impl<T> AbsDiffEq<Quaternion<T>> for Quaternion<T> where
T: AbsDiffEq<Epsilon = T> + Copy,
[src]
impl<T> AbsDiffEq<Quaternion<T>> for Quaternion<T> where
T: AbsDiffEq<Epsilon = T> + Copy,
[src]type Epsilon = T
type Epsilon = T
Used for specifying relative comparisons.
fn default_epsilon() -> Self::Epsilon
[src]
fn default_epsilon() -> Self::Epsilon
[src]The default tolerance to use when testing values that are close together. Read more
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
[src]
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
[src]A test for equality that uses the absolute difference to compute the approximate equality of two numbers. Read more
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
[src]
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
[src]The inverse of AbsDiffEq::abs_diff_eq
.
impl<T> Add<Complex<T>> for Quaternion<T> where
T: Add<Output = T>,
[src]
impl<T> Add<Complex<T>> for Quaternion<T> where
T: Add<Output = T>,
[src]impl<T> Add<Quaternion<T>> for Quaternion<T> where
T: Add<Output = T>,
[src]
impl<T> Add<Quaternion<T>> for Quaternion<T> where
T: Add<Output = T>,
[src]impl Add<Quaternion<f32>> for Complex<f32>
[src]
impl Add<Quaternion<f32>> for Complex<f32>
[src]Workaround for reverse addition.
type Output = Quaternion<f32>
type Output = Quaternion<f32>
The resulting type after applying the +
operator.
impl Add<Quaternion<f64>> for Complex<f64>
[src]
impl Add<Quaternion<f64>> for Complex<f64>
[src]Workaround for reverse addition.
type Output = Quaternion<f64>
type Output = Quaternion<f64>
The resulting type after applying the +
operator.
impl<T> Add<T> for Quaternion<T> where
T: Add<Output = T>,
[src]
impl<T> Add<T> for Quaternion<T> where
T: Add<Output = T>,
[src]impl<T> AddAssign<Complex<T>> for Quaternion<T> where
T: AddAssign,
[src]
impl<T> AddAssign<Complex<T>> for Quaternion<T> where
T: AddAssign,
[src]fn add_assign(&mut self, other: Complex<T>)
[src]
fn add_assign(&mut self, other: Complex<T>)
[src]Performs the +=
operation. Read more
impl<T> AddAssign<Quaternion<T>> for Quaternion<T> where
T: AddAssign,
[src]
impl<T> AddAssign<Quaternion<T>> for Quaternion<T> where
T: AddAssign,
[src]fn add_assign(&mut self, other: Self)
[src]
fn add_assign(&mut self, other: Self)
[src]Performs the +=
operation. Read more
impl<T> AddAssign<T> for Quaternion<T> where
T: AddAssign,
[src]
impl<T> AddAssign<T> for Quaternion<T> where
T: AddAssign,
[src]fn add_assign(&mut self, other: T)
[src]
fn add_assign(&mut self, other: T)
[src]Performs the +=
operation. Read more
impl<T: Clone> Clone for Quaternion<T>
[src]
impl<T: Clone> Clone for Quaternion<T>
[src]fn clone(&self) -> Quaternion<T>
[src]
fn clone(&self) -> Quaternion<T>
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl<T> Conj for Quaternion<T> where
T: Neg<Output = T>,
[src]
impl<T> Conj for Quaternion<T> where
T: Neg<Output = T>,
[src]impl<T: Debug> Debug for Quaternion<T>
[src]
impl<T: Debug> Debug for Quaternion<T>
[src]impl<T: Default> Default for Quaternion<T>
[src]
impl<T: Default> Default for Quaternion<T>
[src]fn default() -> Quaternion<T>
[src]
fn default() -> Quaternion<T>
[src]Returns the “default value” for a type. Read more
impl<T> Directional<Quaternion<T>> for Moebius<Complex<T>> where
Self: Transform<Quaternion<T>>,
Quaternion<T>: Normalize,
[src]
impl<T> Directional<Quaternion<T>> for Moebius<Complex<T>> where
Self: Transform<Quaternion<T>>,
Quaternion<T>: Normalize,
[src]fn apply_dir(&self, pos: Quaternion<T>, dir: Quaternion<T>) -> Quaternion<T>
[src]
fn apply_dir(&self, pos: Quaternion<T>, dir: Quaternion<T>) -> Quaternion<T>
[src]Returns the result of the direction transformation at the specified position.
fn apply_normal(
&self,
pos: Quaternion<T>,
normal: Quaternion<T>
) -> Quaternion<T>
[src]
fn apply_normal(
&self,
pos: Quaternion<T>,
normal: Quaternion<T>
) -> Quaternion<T>
[src]Returns the result of the normal transformation at the specified position. Read more
impl<T: Display> Display for Quaternion<T>
[src]
impl<T: Display> Display for Quaternion<T>
[src]impl<T> Distribution<Quaternion<T>> for Normal where
Normal: Distribution<Vector<T, 4>>,
[src]
impl<T> Distribution<Quaternion<T>> for Normal where
Normal: Distribution<Vector<T, 4>>,
[src]fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Quaternion<T>
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Quaternion<T>
[src]Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
R: Rng,
[src]
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
R: Rng,
[src]Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
impl<T: Float> Distribution<Quaternion<T>> for NonZero where
NonZero: Distribution<Vector<T, 4>>,
[src]
impl<T: Float> Distribution<Quaternion<T>> for NonZero where
NonZero: Distribution<Vector<T, 4>>,
[src]fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Quaternion<T>
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Quaternion<T>
[src]Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
R: Rng,
[src]
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
R: Rng,
[src]Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
impl<T: Float> Distribution<Quaternion<T>> for Unit where
Unit: Distribution<Vector<T, 4>>,
[src]
impl<T: Float> Distribution<Quaternion<T>> for Unit where
Unit: Distribution<Vector<T, 4>>,
[src]fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Quaternion<T>
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Quaternion<T>
[src]Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
R: Rng,
[src]
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
R: Rng,
[src]Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
impl<T> Div<Quaternion<T>> for Quaternion<T> where
T: Neg<Output = T> + Num + Copy,
[src]
impl<T> Div<Quaternion<T>> for Quaternion<T> where
T: Neg<Output = T> + Num + Copy,
[src]impl<T> Div<Quaternion<T>> for Complex<T> where
T: Neg<Output = T> + Num + Copy,
[src]
impl<T> Div<Quaternion<T>> for Complex<T> where
T: Neg<Output = T> + Num + Copy,
[src]type Output = Quaternion<T>
type Output = Quaternion<T>
The resulting type after applying the /
operator.
fn div(self, other: Quaternion<T>) -> Self::Output
[src]
fn div(self, other: Quaternion<T>) -> Self::Output
[src]Performs the /
operation. Read more
impl<T> Div<T> for Quaternion<T> where
T: Div<Output = T> + Copy,
[src]
impl<T> Div<T> for Quaternion<T> where
T: Div<Output = T> + Copy,
[src]impl<T> DivAssign<Complex<T>> for Quaternion<T> where
Self: Div<Complex<T>, Output = Self> + Copy,
[src]
impl<T> DivAssign<Complex<T>> for Quaternion<T> where
Self: Div<Complex<T>, Output = Self> + Copy,
[src]fn div_assign(&mut self, other: Complex<T>)
[src]
fn div_assign(&mut self, other: Complex<T>)
[src]Performs the /=
operation. Read more
impl<T> DivAssign<Quaternion<T>> for Quaternion<T> where
Self: Div<Output = Self> + Copy,
[src]
impl<T> DivAssign<Quaternion<T>> for Quaternion<T> where
Self: Div<Output = Self> + Copy,
[src]fn div_assign(&mut self, other: Self)
[src]
fn div_assign(&mut self, other: Self)
[src]Performs the /=
operation. Read more
impl<T> DivAssign<T> for Quaternion<T> where
Self: Div<T, Output = Self> + Copy,
[src]
impl<T> DivAssign<T> for Quaternion<T> where
Self: Div<T, Output = Self> + Copy,
[src]fn div_assign(&mut self, other: T)
[src]
fn div_assign(&mut self, other: T)
[src]Performs the /=
operation. Read more
impl<T> Dot<Quaternion<T>> for Quaternion<T> where
T: Add<Output = T> + Mul<Output = T>,
[src]
impl<T> Dot<Quaternion<T>> for Quaternion<T> where
T: Add<Output = T> + Mul<Output = T>,
[src]impl<T> From<[T; 4]> for Quaternion<T>
[src]
impl<T> From<[T; 4]> for Quaternion<T>
[src]impl<T> From<(T, T, T, T)> for Quaternion<T>
[src]
impl<T> From<(T, T, T, T)> for Quaternion<T>
[src]impl<T> From<Quaternion<T>> for Vector4<T>
[src]
impl<T> From<Quaternion<T>> for Vector4<T>
[src]fn from(quat: Quaternion<T>) -> Self
[src]
fn from(quat: Quaternion<T>) -> Self
[src]Performs the conversion.
impl<T> From<Quaternion<T>> for Rotation3<T>
[src]
impl<T> From<Quaternion<T>> for Rotation3<T>
[src]fn from(quat: Quaternion<T>) -> Self
[src]
fn from(quat: Quaternion<T>) -> Self
[src]Performs the conversion.
impl<T> From<Rotation3<T>> for Quaternion<T>
[src]
impl<T> From<Rotation3<T>> for Quaternion<T>
[src]impl<T> From<Vector<T, 4_usize>> for Quaternion<T>
[src]
impl<T> From<Vector<T, 4_usize>> for Quaternion<T>
[src]impl<T> Inv for Quaternion<T> where
T: Float,
[src]
impl<T> Inv for Quaternion<T> where
T: Float,
[src]impl<T> Mul<Complex<T>> for Quaternion<T> where
T: Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Copy,
[src]
impl<T> Mul<Complex<T>> for Quaternion<T> where
T: Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Copy,
[src]impl<T> Mul<Quaternion<T>> for Quaternion<T> where
T: Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Copy,
[src]
impl<T> Mul<Quaternion<T>> for Quaternion<T> where
T: Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Copy,
[src]impl<T> Mul<Quaternion<T>> for Complex<T> where
T: Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Copy,
[src]
impl<T> Mul<Quaternion<T>> for Complex<T> where
T: Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Copy,
[src]type Output = Quaternion<T>
type Output = Quaternion<T>
The resulting type after applying the *
operator.
fn mul(self, other: Quaternion<T>) -> Self::Output
[src]
fn mul(self, other: Quaternion<T>) -> Self::Output
[src]Performs the *
operation. Read more
impl<T> Mul<T> for Quaternion<T> where
T: Mul<Output = T> + Copy,
[src]
impl<T> Mul<T> for Quaternion<T> where
T: Mul<Output = T> + Copy,
[src]impl<T> MulAssign<Complex<T>> for Quaternion<T> where
Self: Mul<Complex<T>, Output = Self> + Copy,
[src]
impl<T> MulAssign<Complex<T>> for Quaternion<T> where
Self: Mul<Complex<T>, Output = Self> + Copy,
[src]fn mul_assign(&mut self, other: Complex<T>)
[src]
fn mul_assign(&mut self, other: Complex<T>)
[src]Performs the *=
operation. Read more
impl<T> MulAssign<Quaternion<T>> for Quaternion<T> where
Self: Mul<Output = Self> + Copy,
[src]
impl<T> MulAssign<Quaternion<T>> for Quaternion<T> where
Self: Mul<Output = Self> + Copy,
[src]fn mul_assign(&mut self, other: Self)
[src]
fn mul_assign(&mut self, other: Self)
[src]Performs the *=
operation. Read more
impl<T> MulAssign<T> for Quaternion<T> where
Self: Mul<T, Output = Self> + Copy,
[src]
impl<T> MulAssign<T> for Quaternion<T> where
Self: Mul<T, Output = Self> + Copy,
[src]fn mul_assign(&mut self, other: T)
[src]
fn mul_assign(&mut self, other: T)
[src]Performs the *=
operation. Read more
impl<T> Neg for Quaternion<T> where
T: Neg<Output = T>,
[src]
impl<T> Neg for Quaternion<T> where
T: Neg<Output = T>,
[src]impl<T> NormL1 for Quaternion<T> where
Vector4<T>: NormL1<Output = T>,
[src]
impl<T> NormL1 for Quaternion<T> where
Vector4<T>: NormL1<Output = T>,
[src]impl<T: Float> NormL2 for Quaternion<T>
[src]
impl<T: Float> NormL2 for Quaternion<T>
[src]impl<T> Normalize for Quaternion<T> where
T: Float,
[src]
impl<T> Normalize for Quaternion<T> where
T: Float,
[src]impl<T: Neg<Output = T> + Num + Copy> Num for Quaternion<T>
[src]
impl<T: Neg<Output = T> + Num + Copy> Num for Quaternion<T>
[src]type FromStrRadixErr = T::FromStrRadixErr
fn from_str_radix(_s: &str, _radix: u32) -> Result<Self, Self::FromStrRadixErr>
[src]
fn from_str_radix(_s: &str, _radix: u32) -> Result<Self, Self::FromStrRadixErr>
[src]Convert from a string and radix (typically 2..=36
). Read more
impl<T: PartialEq> PartialEq<Quaternion<T>> for Quaternion<T>
[src]
impl<T: PartialEq> PartialEq<Quaternion<T>> for Quaternion<T>
[src]fn eq(&self, other: &Quaternion<T>) -> bool
[src]
fn eq(&self, other: &Quaternion<T>) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &Quaternion<T>) -> bool
[src]
fn ne(&self, other: &Quaternion<T>) -> bool
[src]This method tests for !=
.
impl<T: Neg<Output = T> + Num + Copy> Rem<Quaternion<T>> for Quaternion<T>
[src]
impl<T: Neg<Output = T> + Num + Copy> Rem<Quaternion<T>> for Quaternion<T>
[src]impl<T> Sub<Complex<T>> for Quaternion<T> where
T: Sub<Output = T>,
[src]
impl<T> Sub<Complex<T>> for Quaternion<T> where
T: Sub<Output = T>,
[src]impl<T> Sub<Quaternion<T>> for Quaternion<T> where
T: Sub<Output = T>,
[src]
impl<T> Sub<Quaternion<T>> for Quaternion<T> where
T: Sub<Output = T>,
[src]impl Sub<Quaternion<f32>> for Complex<f32>
[src]
impl Sub<Quaternion<f32>> for Complex<f32>
[src]Workaround for reverse subtraction.
type Output = Quaternion<f32>
type Output = Quaternion<f32>
The resulting type after applying the -
operator.
impl Sub<Quaternion<f64>> for Complex<f64>
[src]
impl Sub<Quaternion<f64>> for Complex<f64>
[src]Workaround for reverse subtraction.
type Output = Quaternion<f64>
type Output = Quaternion<f64>
The resulting type after applying the -
operator.
impl<T> Sub<T> for Quaternion<T> where
T: Sub<Output = T>,
[src]
impl<T> Sub<T> for Quaternion<T> where
T: Sub<Output = T>,
[src]impl<T> SubAssign<Complex<T>> for Quaternion<T> where
T: SubAssign,
[src]
impl<T> SubAssign<Complex<T>> for Quaternion<T> where
T: SubAssign,
[src]fn sub_assign(&mut self, other: Complex<T>)
[src]
fn sub_assign(&mut self, other: Complex<T>)
[src]Performs the -=
operation. Read more
impl<T> SubAssign<Quaternion<T>> for Quaternion<T> where
T: SubAssign,
[src]
impl<T> SubAssign<Quaternion<T>> for Quaternion<T> where
T: SubAssign,
[src]fn sub_assign(&mut self, other: Self)
[src]
fn sub_assign(&mut self, other: Self)
[src]Performs the -=
operation. Read more
impl<T> SubAssign<T> for Quaternion<T> where
T: SubAssign,
[src]
impl<T> SubAssign<T> for Quaternion<T> where
T: SubAssign,
[src]fn sub_assign(&mut self, other: T)
[src]
fn sub_assign(&mut self, other: T)
[src]Performs the -=
operation. Read more
impl<T> Transform<Quaternion<T>> for Moebius<Complex<T>> where
T: Neg<Output = T> + Num + NumCast + Copy,
[src]
impl<T> Transform<Quaternion<T>> for Moebius<Complex<T>> where
T: Neg<Output = T> + Num + NumCast + Copy,
[src]fn apply(&self, pos: Quaternion<T>) -> Quaternion<T>
[src]
fn apply(&self, pos: Quaternion<T>) -> Quaternion<T>
[src]Perform the transformation itself.
fn deriv(&self, pos: Quaternion<T>, dir: Quaternion<T>) -> Quaternion<T>
[src]
fn deriv(&self, pos: Quaternion<T>, dir: Quaternion<T>) -> Quaternion<T>
[src]Find transformation directional derivative at specified point.
impl<T> Zero for Quaternion<T> where
T: Zero,
[src]
impl<T> Zero for Quaternion<T> where
T: Zero,
[src]impl<T: Copy> Copy for Quaternion<T>
[src]
impl<T> StructuralPartialEq for Quaternion<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Quaternion<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Quaternion<T> where
T: Send,
T: Send,
impl<T> Sync for Quaternion<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Quaternion<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Quaternion<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,
[src]
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,