[−][src]Struct bno055::Quaternion
A quaternion. See the type alias UnitQuaternion = Unit<Quaternion>
for a quaternion
that may be used as a rotation.
Fields
coords: Matrix<N, U4, U1, <DefaultAllocator as Allocator<N, U4, U1>>::Buffer>
This quaternion as a 4D vector of coordinates in the [ x, y, z, w ]
storage order.
Methods
impl<N> Quaternion<N> where
N: Real,
[src]
N: Real,
pub fn into_owned(self) -> Quaternion<N>
[src]
This method is a no-op and will be removed in a future release.
Moves this unit quaternion into one that owns its data.
pub fn clone_owned(&self) -> Quaternion<N>
[src]
This method is a no-op and will be removed in a future release.
Clones this unit quaternion into one that owns its data.
pub fn normalize(&self) -> Quaternion<N>
[src]
Normalizes this quaternion.
Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0); let q_normalized = q.normalize(); relative_eq!(q_normalized.norm(), 1.0);
pub fn conjugate(&self) -> Quaternion<N>
[src]
The conjugate of this quaternion.
Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0); let conj = q.conjugate(); assert!(conj.i == -2.0 && conj.j == -3.0 && conj.k == -4.0 && conj.w == 1.0);
pub fn try_inverse(&self) -> Option<Quaternion<N>>
[src]
Inverts this quaternion if it is not zero.
Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0); let inv_q = q.try_inverse(); assert!(inv_q.is_some()); assert_relative_eq!(inv_q.unwrap() * q, Quaternion::identity()); //Non-invertible case let q = Quaternion::new(0.0, 0.0, 0.0, 0.0); let inv_q = q.try_inverse(); assert!(inv_q.is_none());
pub fn lerp(&self, other: &Quaternion<N>, t: N) -> Quaternion<N>
[src]
Linear interpolation between two quaternion.
Computes self * (1 - t) + other * t
.
Example
let q1 = Quaternion::new(1.0, 2.0, 3.0, 4.0); let q2 = Quaternion::new(10.0, 20.0, 30.0, 40.0); assert_eq!(q1.lerp(&q2, 0.1), Quaternion::new(1.9, 3.8, 5.7, 7.6));
pub fn vector(
&self
) -> Matrix<N, U3, U1, SliceStorage<N, U3, U1, <<DefaultAllocator as Allocator<N, U4, U1>>::Buffer as Storage<N, U4, U1>>::RStride, <<DefaultAllocator as Allocator<N, U4, U1>>::Buffer as Storage<N, U4, U1>>::CStride>>
[src]
&self
) -> Matrix<N, U3, U1, SliceStorage<N, U3, U1, <<DefaultAllocator as Allocator<N, U4, U1>>::Buffer as Storage<N, U4, U1>>::RStride, <<DefaultAllocator as Allocator<N, U4, U1>>::Buffer as Storage<N, U4, U1>>::CStride>>
The vector part (i, j, k)
of this quaternion.
Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0); assert_eq!(q.vector()[0], 2.0); assert_eq!(q.vector()[1], 3.0); assert_eq!(q.vector()[2], 4.0);
pub fn scalar(&self) -> N
[src]
The scalar part w
of this quaternion.
Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0); assert_eq!(q.scalar(), 1.0);
pub fn as_vector(
&self
) -> &Matrix<N, U4, U1, <DefaultAllocator as Allocator<N, U4, U1>>::Buffer>
[src]
&self
) -> &Matrix<N, U4, U1, <DefaultAllocator as Allocator<N, U4, U1>>::Buffer>
Reinterprets this quaternion as a 4D vector.
Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0); // Recall that the quaternion is stored internally as (i, j, k, w) // while the ::new constructor takes the arguments as (w, i, j, k). assert_eq!(*q.as_vector(), Vector4::new(2.0, 3.0, 4.0, 1.0));
pub fn norm(&self) -> N
[src]
The norm of this quaternion.
Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0); assert_relative_eq!(q.norm(), 5.47722557, epsilon = 1.0e-6);
pub fn magnitude(&self) -> N
[src]
A synonym for the norm of this quaternion.
Aka the length.
This is the same as .norm()
Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0); assert_relative_eq!(q.magnitude(), 5.47722557, epsilon = 1.0e-6);
pub fn norm_squared(&self) -> N
[src]
The squared norm of this quaternion.
Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0); assert_eq!(q.magnitude_squared(), 30.0);
pub fn magnitude_squared(&self) -> N
[src]
A synonym for the squared norm of this quaternion.
Aka the squared length.
This is the same as .norm_squared()
Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0); assert_eq!(q.magnitude_squared(), 30.0);
pub fn dot(&self, rhs: &Quaternion<N>) -> N
[src]
The dot product of two quaternions.
Example
let q1 = Quaternion::new(1.0, 2.0, 3.0, 4.0); let q2 = Quaternion::new(5.0, 6.0, 7.0, 8.0); assert_eq!(q1.dot(&q2), 70.0);
pub fn polar_decomposition(
&self
) -> (N, N, Option<Unit<Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3, U1>>::Buffer>>>)
[src]
&self
) -> (N, N, Option<Unit<Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3, U1>>::Buffer>>>)
The polar decomposition of this quaternion.
Returns, from left to right: the quaternion norm, the half rotation angle, the rotation
axis. If the rotation angle is zero, the rotation axis is set to None
.
Example
let q = Quaternion::new(0.0, 5.0, 0.0, 0.0); let (norm, half_ang, axis) = q.polar_decomposition(); assert_eq!(norm, 5.0); assert_eq!(half_ang, f32::consts::FRAC_PI_2); assert_eq!(axis, Some(Vector3::x_axis()));
pub fn ln(&self) -> Quaternion<N>
[src]
Compute the natural logarithm of a quaternion.
Example
let q = Quaternion::new(2.0, 5.0, 0.0, 0.0); assert_relative_eq!(q.ln(), Quaternion::new(1.683647, 1.190289, 0.0, 0.0), epsilon = 1.0e-6)
pub fn exp(&self) -> Quaternion<N>
[src]
Compute the exponential of a quaternion.
Example
let q = Quaternion::new(1.683647, 1.190289, 0.0, 0.0); assert_relative_eq!(q.exp(), Quaternion::new(2.0, 5.0, 0.0, 0.0), epsilon = 1.0e-5)
pub fn exp_eps(&self, eps: N) -> Quaternion<N>
[src]
Compute the exponential of a quaternion. Returns the identity if the vector part of this quaternion
has a norm smaller than eps
.
Example
let q = Quaternion::new(1.683647, 1.190289, 0.0, 0.0); assert_relative_eq!(q.exp_eps(1.0e-6), Quaternion::new(2.0, 5.0, 0.0, 0.0), epsilon = 1.0e-5); // Singular case. let q = Quaternion::new(0.0000001, 0.0, 0.0, 0.0); assert_eq!(q.exp_eps(1.0e-6), Quaternion::identity());
pub fn powf(&self, n: N) -> Quaternion<N>
[src]
Raise the quaternion to a given floating power.
Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0); assert_relative_eq!(q.powf(1.5), Quaternion::new( -6.2576659, 4.1549037, 6.2323556, 8.3098075), epsilon = 1.0e-6);
pub fn as_vector_mut(
&mut self
) -> &mut Matrix<N, U4, U1, <DefaultAllocator as Allocator<N, U4, U1>>::Buffer>
[src]
&mut self
) -> &mut Matrix<N, U4, U1, <DefaultAllocator as Allocator<N, U4, U1>>::Buffer>
Transforms this quaternion into its 4D vector form (Vector part, Scalar part).
Example
let mut q = Quaternion::identity(); *q.as_vector_mut() = Vector4::new(1.0, 2.0, 3.0, 4.0); assert!(q.i == 1.0 && q.j == 2.0 && q.k == 3.0 && q.w == 4.0);
pub fn vector_mut(
&mut self
) -> Matrix<N, U3, U1, SliceStorageMut<N, U3, U1, <<DefaultAllocator as Allocator<N, U4, U1>>::Buffer as Storage<N, U4, U1>>::RStride, <<DefaultAllocator as Allocator<N, U4, U1>>::Buffer as Storage<N, U4, U1>>::CStride>>
[src]
&mut self
) -> Matrix<N, U3, U1, SliceStorageMut<N, U3, U1, <<DefaultAllocator as Allocator<N, U4, U1>>::Buffer as Storage<N, U4, U1>>::RStride, <<DefaultAllocator as Allocator<N, U4, U1>>::Buffer as Storage<N, U4, U1>>::CStride>>
The mutable vector part (i, j, k)
of this quaternion.
Example
let mut q = Quaternion::identity(); { let mut v = q.vector_mut(); v[0] = 2.0; v[1] = 3.0; v[2] = 4.0; } assert!(q.i == 2.0 && q.j == 3.0 && q.k == 4.0 && q.w == 1.0);
pub fn conjugate_mut(&mut self)
[src]
Replaces this quaternion by its conjugate.
Example
let mut q = Quaternion::new(1.0, 2.0, 3.0, 4.0); q.conjugate_mut(); assert!(q.i == -2.0 && q.j == -3.0 && q.k == -4.0 && q.w == 1.0);
pub fn try_inverse_mut(&mut self) -> bool
[src]
Inverts this quaternion in-place if it is not zero.
Example
let mut q = Quaternion::new(1.0, 2.0, 3.0, 4.0); assert!(q.try_inverse_mut()); assert_relative_eq!(q * Quaternion::new(1.0, 2.0, 3.0, 4.0), Quaternion::identity()); //Non-invertible case let mut q = Quaternion::new(0.0, 0.0, 0.0, 0.0); assert!(!q.try_inverse_mut());
pub fn normalize_mut(&mut self) -> N
[src]
Normalizes this quaternion.
Example
let mut q = Quaternion::new(1.0, 2.0, 3.0, 4.0); q.normalize_mut(); assert_relative_eq!(q.norm(), 1.0);
impl<N> Quaternion<N> where
N: Real,
[src]
N: Real,
pub fn from_vector(
vector: Matrix<N, U4, U1, <DefaultAllocator as Allocator<N, U4, U1>>::Buffer>
) -> Quaternion<N>
[src]
vector: Matrix<N, U4, U1, <DefaultAllocator as Allocator<N, U4, U1>>::Buffer>
) -> Quaternion<N>
Use ::from
instead.
Creates a quaternion from a 4D vector. The quaternion scalar part corresponds to the w
vector component.
pub fn new(w: N, i: N, j: N, k: N) -> Quaternion<N>
[src]
Creates a new quaternion from its individual components. Note that the arguments order does not follow the storage order.
The storage order is [ i, j, k, w ]
while the arguments for this functions are in the
order (w, i, j, k)
.
Example
let q = Quaternion::new(1.0, 2.0, 3.0, 4.0); assert!(q.i == 2.0 && q.j == 3.0 && q.k == 4.0 && q.w == 1.0); assert_eq!(*q.as_vector(), Vector4::new(2.0, 3.0, 4.0, 1.0));
pub fn from_parts<SB>(scalar: N, vector: Matrix<N, U3, U1, SB>) -> Quaternion<N> where
SB: Storage<N, U3, U1>,
[src]
SB: Storage<N, U3, U1>,
Creates a new quaternion from its scalar and vector parts. Note that the arguments order does not follow the storage order.
The storage order is [ vector, scalar ].
Example
let w = 1.0; let ijk = Vector3::new(2.0, 3.0, 4.0); let q = Quaternion::from_parts(w, ijk); assert!(q.i == 2.0 && q.j == 3.0 && q.k == 4.0 && q.w == 1.0); assert_eq!(*q.as_vector(), Vector4::new(2.0, 3.0, 4.0, 1.0));
pub fn from_polar_decomposition<SB>(
scale: N,
theta: N,
axis: Unit<Matrix<N, U3, U1, SB>>
) -> Quaternion<N> where
SB: Storage<N, U3, U1>,
[src]
scale: N,
theta: N,
axis: Unit<Matrix<N, U3, U1, SB>>
) -> Quaternion<N> where
SB: Storage<N, U3, U1>,
Creates a new quaternion from its polar decomposition.
Note that axis
is assumed to be a unit vector.
pub fn identity() -> Quaternion<N>
[src]
The quaternion multiplicative identity.
Example
let q = Quaternion::identity(); let q2 = Quaternion::new(1.0, 2.0, 3.0, 4.0); assert_eq!(q * q2, q2); assert_eq!(q2 * q, q2);
Trait Implementations
impl<N> AbstractQuasigroup<Additive> for Quaternion<N> where
N: Real,
[src]
N: Real,
fn prop_inv_is_latin_square_approx(args: (Self, Self)) -> bool where
Self: RelativeEq,
Self: RelativeEq,
Returns true
if latin squareness holds for the given arguments. Approximate equality is used for verifications. Read more
fn prop_inv_is_latin_square(args: (Self, Self)) -> bool where
Self: Eq,
Self: Eq,
Returns true
if latin squareness holds for the given arguments. Read more
impl<N> AbstractMagma<Additive> for Quaternion<N> where
N: Real,
[src]
N: Real,
fn operate(&self, rhs: &Quaternion<N>) -> Quaternion<N>
[src]
fn op(&self, O, lhs: &Self) -> Self
Performs specific operation.
impl<N> AbstractMagma<Multiplicative> for Quaternion<N> where
N: Real,
[src]
N: Real,
fn operate(&self, rhs: &Quaternion<N>) -> Quaternion<N>
[src]
fn op(&self, O, lhs: &Self) -> Self
Performs specific operation.
impl<N> VectorSpace for Quaternion<N> where
N: Real,
[src]
N: Real,
type Field = N
The underlying scalar field.
impl<N> PartialEq<Quaternion<N>> for Quaternion<N> where
N: Real,
[src]
N: Real,
fn eq(&self, rhs: &Quaternion<N>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<N> Mul<N> for Quaternion<N> where
N: Real,
[src]
N: Real,
type Output = Quaternion<N>
The resulting type after applying the *
operator.
fn mul(self, n: N) -> <Quaternion<N> as Mul<N>>::Output
[src]
impl<'b, N> Mul<&'b Quaternion<N>> for Quaternion<N> where
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
type Output = Quaternion<N>
The resulting type after applying the *
operator.
fn mul(
self,
rhs: &'b Quaternion<N>
) -> <Quaternion<N> as Mul<&'b Quaternion<N>>>::Output
[src]
self,
rhs: &'b Quaternion<N>
) -> <Quaternion<N> as Mul<&'b Quaternion<N>>>::Output
impl<'a, N> Mul<N> for &'a Quaternion<N> where
N: Real,
[src]
N: Real,
type Output = Quaternion<N>
The resulting type after applying the *
operator.
fn mul(self, n: N) -> <&'a Quaternion<N> as Mul<N>>::Output
[src]
impl<'a, N> Mul<Quaternion<N>> for &'a Quaternion<N> where
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
type Output = Quaternion<N>
The resulting type after applying the *
operator.
fn mul(
self,
rhs: Quaternion<N>
) -> <&'a Quaternion<N> as Mul<Quaternion<N>>>::Output
[src]
self,
rhs: Quaternion<N>
) -> <&'a Quaternion<N> as Mul<Quaternion<N>>>::Output
impl<'a, 'b, N> Mul<&'b Quaternion<N>> for &'a Quaternion<N> where
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
type Output = Quaternion<N>
The resulting type after applying the *
operator.
fn mul(
self,
rhs: &'b Quaternion<N>
) -> <&'a Quaternion<N> as Mul<&'b Quaternion<N>>>::Output
[src]
self,
rhs: &'b Quaternion<N>
) -> <&'a Quaternion<N> as Mul<&'b Quaternion<N>>>::Output
impl<N> Mul<Quaternion<N>> for Quaternion<N> where
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
type Output = Quaternion<N>
The resulting type after applying the *
operator.
fn mul(
self,
rhs: Quaternion<N>
) -> <Quaternion<N> as Mul<Quaternion<N>>>::Output
[src]
self,
rhs: Quaternion<N>
) -> <Quaternion<N> as Mul<Quaternion<N>>>::Output
impl<N> From<Matrix<N, U4, U1, <DefaultAllocator as Allocator<N, U4, U1>>::Buffer>> for Quaternion<N> where
N: Real,
[src]
N: Real,
fn from(
coords: Matrix<N, U4, U1, <DefaultAllocator as Allocator<N, U4, U1>>::Buffer>
) -> Quaternion<N>
[src]
coords: Matrix<N, U4, U1, <DefaultAllocator as Allocator<N, U4, U1>>::Buffer>
) -> Quaternion<N>
impl<N> AbstractGroup<Additive> for Quaternion<N> where
N: Real,
[src]
N: Real,
impl<N> Module for Quaternion<N> where
N: Real,
[src]
N: Real,
type Ring = N
The underlying scalar field.
impl<'a, N> Neg for &'a Quaternion<N> where
N: Real,
[src]
N: Real,
type Output = Quaternion<N>
The resulting type after applying the -
operator.
fn neg(self) -> <&'a Quaternion<N> as Neg>::Output
[src]
impl<N> Neg for Quaternion<N> where
N: Real,
[src]
N: Real,
type Output = Quaternion<N>
The resulting type after applying the -
operator.
fn neg(self) -> <Quaternion<N> as Neg>::Output
[src]
impl<N> One for Quaternion<N> where
N: Real,
[src]
N: Real,
fn one() -> Quaternion<N>
[src]
fn is_one(&self) -> bool where
Self: PartialEq<Self>,
[src]
Self: PartialEq<Self>,
Returns true
if self
is equal to the multiplicative identity. Read more
impl<N> Identity<Multiplicative> for Quaternion<N> where
N: Real,
[src]
N: Real,
impl<N> Identity<Additive> for Quaternion<N> where
N: Real,
[src]
N: Real,
impl<N> Index<usize> for Quaternion<N> where
N: Real,
[src]
N: Real,
impl<N> NormedSpace for Quaternion<N> where
N: Real,
[src]
N: Real,
fn norm_squared(&self) -> N
[src]
fn norm(&self) -> N
[src]
fn normalize(&self) -> Quaternion<N>
[src]
fn normalize_mut(&mut self) -> N
[src]
fn try_normalize(&self, min_norm: N) -> Option<Quaternion<N>>
[src]
fn try_normalize_mut(&mut self, min_norm: N) -> Option<N>
[src]
impl<N> Copy for Quaternion<N> where
N: Real,
[src]
N: Real,
impl<N> AbstractModule<Additive, Additive, Multiplicative> for Quaternion<N> where
N: Real,
[src]
N: Real,
impl<N> TwoSidedInverse<Additive> for Quaternion<N> where
N: Real,
[src]
N: Real,
fn two_sided_inverse(&self) -> Quaternion<N>
[src]
fn two_sided_inverse_mut(&mut self)
In-place inversion of self
, relative to the operator O
. Read more
impl<N> MulAssign<N> for Quaternion<N> where
N: Real,
[src]
N: Real,
fn mul_assign(&mut self, n: N)
[src]
impl<N> MulAssign<Quaternion<N>> for Quaternion<N> where
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
fn mul_assign(&mut self, rhs: Quaternion<N>)
[src]
impl<'b, N> MulAssign<&'b Quaternion<N>> for Quaternion<N> where
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
fn mul_assign(&mut self, rhs: &'b Quaternion<N>)
[src]
impl<N> DivAssign<N> for Quaternion<N> where
N: Real,
[src]
N: Real,
fn div_assign(&mut self, n: N)
[src]
impl<'b, N> AddAssign<&'b Quaternion<N>> for Quaternion<N> where
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
fn add_assign(&mut self, rhs: &'b Quaternion<N>)
[src]
impl<N> AddAssign<Quaternion<N>> for Quaternion<N> where
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
fn add_assign(&mut self, rhs: Quaternion<N>)
[src]
impl<'b, N> SubAssign<&'b Quaternion<N>> for Quaternion<N> where
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
fn sub_assign(&mut self, rhs: &'b Quaternion<N>)
[src]
impl<N> SubAssign<Quaternion<N>> for Quaternion<N> where
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
fn sub_assign(&mut self, rhs: Quaternion<N>)
[src]
impl<N> Clone for Quaternion<N> where
N: Real,
[src]
N: Real,
fn clone(&self) -> Quaternion<N>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<N> AbstractMonoid<Multiplicative> for Quaternion<N> where
N: Real,
[src]
N: Real,
fn prop_operating_identity_element_is_noop_approx(args: (Self,)) -> bool where
Self: RelativeEq,
Self: RelativeEq,
Checks whether operating with the identity element is a no-op for the given argument. Approximate equality is used for verifications. Read more
fn prop_operating_identity_element_is_noop(args: (Self,)) -> bool where
Self: Eq,
Self: Eq,
Checks whether operating with the identity element is a no-op for the given argument. Read more
impl<N> AbstractMonoid<Additive> for Quaternion<N> where
N: Real,
[src]
N: Real,
fn prop_operating_identity_element_is_noop_approx(args: (Self,)) -> bool where
Self: RelativeEq,
Self: RelativeEq,
Checks whether operating with the identity element is a no-op for the given argument. Approximate equality is used for verifications. Read more
fn prop_operating_identity_element_is_noop(args: (Self,)) -> bool where
Self: Eq,
Self: Eq,
Checks whether operating with the identity element is a no-op for the given argument. Read more
impl<N> AbstractSemigroup<Multiplicative> for Quaternion<N> where
N: Real,
[src]
N: Real,
fn prop_is_associative_approx(args: (Self, Self, Self)) -> bool where
Self: RelativeEq,
Self: RelativeEq,
Returns true
if associativity holds for the given arguments. Approximate equality is used for verifications. Read more
fn prop_is_associative(args: (Self, Self, Self)) -> bool where
Self: Eq,
Self: Eq,
Returns true
if associativity holds for the given arguments.
impl<N> AbstractSemigroup<Additive> for Quaternion<N> where
N: Real,
[src]
N: Real,
fn prop_is_associative_approx(args: (Self, Self, Self)) -> bool where
Self: RelativeEq,
Self: RelativeEq,
Returns true
if associativity holds for the given arguments. Approximate equality is used for verifications. Read more
fn prop_is_associative(args: (Self, Self, Self)) -> bool where
Self: Eq,
Self: Eq,
Returns true
if associativity holds for the given arguments.
impl<N1, N2> SubsetOf<Quaternion<N2>> for Quaternion<N1> where
N1: Real,
N2: Real + SupersetOf<N1>,
[src]
N1: Real,
N2: Real + SupersetOf<N1>,
fn to_superset(&self) -> Quaternion<N2>
[src]
fn is_in_subset(q: &Quaternion<N2>) -> bool
[src]
unsafe fn from_superset_unchecked(q: &Quaternion<N2>) -> Quaternion<N1>
[src]
fn from_superset(element: &T) -> Option<Self>
The inverse inclusion map: attempts to construct self
from the equivalent element of its superset. Read more
impl<'a, N> Sub<Quaternion<N>> for &'a Quaternion<N> where
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
type Output = Quaternion<N>
The resulting type after applying the -
operator.
fn sub(
self,
rhs: Quaternion<N>
) -> <&'a Quaternion<N> as Sub<Quaternion<N>>>::Output
[src]
self,
rhs: Quaternion<N>
) -> <&'a Quaternion<N> as Sub<Quaternion<N>>>::Output
impl<N> Sub<Quaternion<N>> for Quaternion<N> where
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
type Output = Quaternion<N>
The resulting type after applying the -
operator.
fn sub(
self,
rhs: Quaternion<N>
) -> <Quaternion<N> as Sub<Quaternion<N>>>::Output
[src]
self,
rhs: Quaternion<N>
) -> <Quaternion<N> as Sub<Quaternion<N>>>::Output
impl<'a, 'b, N> Sub<&'b Quaternion<N>> for &'a Quaternion<N> where
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
type Output = Quaternion<N>
The resulting type after applying the -
operator.
fn sub(
self,
rhs: &'b Quaternion<N>
) -> <&'a Quaternion<N> as Sub<&'b Quaternion<N>>>::Output
[src]
self,
rhs: &'b Quaternion<N>
) -> <&'a Quaternion<N> as Sub<&'b Quaternion<N>>>::Output
impl<'b, N> Sub<&'b Quaternion<N>> for Quaternion<N> where
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
type Output = Quaternion<N>
The resulting type after applying the -
operator.
fn sub(
self,
rhs: &'b Quaternion<N>
) -> <Quaternion<N> as Sub<&'b Quaternion<N>>>::Output
[src]
self,
rhs: &'b Quaternion<N>
) -> <Quaternion<N> as Sub<&'b Quaternion<N>>>::Output
impl<N> Eq for Quaternion<N> where
N: Eq + Real,
[src]
N: Eq + Real,
impl<N> Display for Quaternion<N> where
N: Display + Real,
[src]
N: Display + Real,
impl<'b, N> Add<&'b Quaternion<N>> for Quaternion<N> where
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
type Output = Quaternion<N>
The resulting type after applying the +
operator.
fn add(
self,
rhs: &'b Quaternion<N>
) -> <Quaternion<N> as Add<&'b Quaternion<N>>>::Output
[src]
self,
rhs: &'b Quaternion<N>
) -> <Quaternion<N> as Add<&'b Quaternion<N>>>::Output
impl<'a, 'b, N> Add<&'b Quaternion<N>> for &'a Quaternion<N> where
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
type Output = Quaternion<N>
The resulting type after applying the +
operator.
fn add(
self,
rhs: &'b Quaternion<N>
) -> <&'a Quaternion<N> as Add<&'b Quaternion<N>>>::Output
[src]
self,
rhs: &'b Quaternion<N>
) -> <&'a Quaternion<N> as Add<&'b Quaternion<N>>>::Output
impl<'a, N> Add<Quaternion<N>> for &'a Quaternion<N> where
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
type Output = Quaternion<N>
The resulting type after applying the +
operator.
fn add(
self,
rhs: Quaternion<N>
) -> <&'a Quaternion<N> as Add<Quaternion<N>>>::Output
[src]
self,
rhs: Quaternion<N>
) -> <&'a Quaternion<N> as Add<Quaternion<N>>>::Output
impl<N> Add<Quaternion<N>> for Quaternion<N> where
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
N: Real,
DefaultAllocator: Allocator<N, U4, U1>,
DefaultAllocator: Allocator<N, U4, U1>,
type Output = Quaternion<N>
The resulting type after applying the +
operator.
fn add(
self,
rhs: Quaternion<N>
) -> <Quaternion<N> as Add<Quaternion<N>>>::Output
[src]
self,
rhs: Quaternion<N>
) -> <Quaternion<N> as Add<Quaternion<N>>>::Output
impl<N> IndexMut<usize> for Quaternion<N> where
N: Real,
[src]
N: Real,
impl<N> Div<N> for Quaternion<N> where
N: Real,
[src]
N: Real,
type Output = Quaternion<N>
The resulting type after applying the /
operator.
fn div(self, n: N) -> <Quaternion<N> as Div<N>>::Output
[src]
impl<'a, N> Div<N> for &'a Quaternion<N> where
N: Real,
[src]
N: Real,
type Output = Quaternion<N>
The resulting type after applying the /
operator.
fn div(self, n: N) -> <&'a Quaternion<N> as Div<N>>::Output
[src]
impl<N> DerefMut for Quaternion<N> where
N: Real,
[src]
N: Real,
fn deref_mut(&mut self) -> &mut <Quaternion<N> as Deref>::Target
[src]
impl<N> AbstractLoop<Additive> for Quaternion<N> where
N: Real,
[src]
N: Real,
impl<N> AbsDiffEq for Quaternion<N> where
N: AbsDiffEq<Epsilon = N> + Real,
[src]
N: AbsDiffEq<Epsilon = N> + Real,
type Epsilon = N
Used for specifying relative comparisons.
fn default_epsilon() -> <Quaternion<N> as AbsDiffEq>::Epsilon
[src]
fn abs_diff_eq(
&self,
other: &Quaternion<N>,
epsilon: <Quaternion<N> as AbsDiffEq>::Epsilon
) -> bool
[src]
&self,
other: &Quaternion<N>,
epsilon: <Quaternion<N> as AbsDiffEq>::Epsilon
) -> bool
fn abs_diff_ne(&self, other: &Self, epsilon: Self::Epsilon) -> bool
The inverse of ApproxEq::abs_diff_eq
.
impl<N> AbstractGroupAbelian<Additive> for Quaternion<N> where
N: Real,
[src]
N: Real,
fn prop_is_commutative_approx(args: (Self, Self)) -> bool where
Self: RelativeEq,
Self: RelativeEq,
Returns true
if the operator is commutative for the given argument tuple. Approximate equality is used for verifications. Read more
fn prop_is_commutative(args: (Self, Self)) -> bool where
Self: Eq,
Self: Eq,
Returns true
if the operator is commutative for the given argument tuple.
impl<N> Zero for Quaternion<N> where
N: Real,
[src]
N: Real,
fn zero() -> Quaternion<N>
[src]
fn is_zero(&self) -> bool
[src]
impl<N> Debug for Quaternion<N> where
N: Debug + Real,
[src]
N: Debug + Real,
impl<N> FiniteDimVectorSpace for Quaternion<N> where
N: Real,
[src]
N: Real,
fn dimension() -> usize
[src]
fn canonical_basis_element(i: usize) -> Quaternion<N>
[src]
fn dot(&self, other: &Quaternion<N>) -> N
[src]
unsafe fn component_unchecked(&self, i: usize) -> &N
[src]
unsafe fn component_unchecked_mut(&mut self, i: usize) -> &mut N
[src]
fn canonical_basis<F>(f: F) where
F: FnMut(&Self) -> bool,
F: FnMut(&Self) -> bool,
Applies the given closule to each element of this vector space's canonical basis. Stops if f
returns false
. Read more
impl<N> RelativeEq for Quaternion<N> where
N: RelativeEq<Epsilon = N> + Real,
[src]
N: RelativeEq<Epsilon = N> + Real,
fn default_max_relative() -> <Quaternion<N> as AbsDiffEq>::Epsilon
[src]
fn relative_eq(
&self,
other: &Quaternion<N>,
epsilon: <Quaternion<N> as AbsDiffEq>::Epsilon,
max_relative: <Quaternion<N> as AbsDiffEq>::Epsilon
) -> bool
[src]
&self,
other: &Quaternion<N>,
epsilon: <Quaternion<N> as AbsDiffEq>::Epsilon,
max_relative: <Quaternion<N> as AbsDiffEq>::Epsilon
) -> bool
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
The inverse of ApproxEq::relative_eq
.
impl<N> Deref for Quaternion<N> where
N: Real,
[src]
N: Real,
type Target = IJKW<N>
The resulting type after dereferencing.
fn deref(&self) -> &<Quaternion<N> as Deref>::Target
[src]
impl<N> UlpsEq for Quaternion<N> where
N: UlpsEq<Epsilon = N> + Real,
[src]
N: UlpsEq<Epsilon = N> + Real,
fn default_max_ulps() -> u32
[src]
fn ulps_eq(
&self,
other: &Quaternion<N>,
epsilon: <Quaternion<N> as AbsDiffEq>::Epsilon,
max_ulps: u32
) -> bool
[src]
&self,
other: &Quaternion<N>,
epsilon: <Quaternion<N> as AbsDiffEq>::Epsilon,
max_ulps: u32
) -> bool
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
The inverse of ApproxEq::ulps_eq
.
impl<N> Hash for Quaternion<N> where
N: Hash + Real,
[src]
N: Hash + Real,
Auto Trait Implementations
impl<N> Send for Quaternion<N> where
N: Scalar,
N: Scalar,
impl<N> Sync for Quaternion<N> where
N: Scalar,
N: Scalar,
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Scalar for T where
T: Copy + PartialEq<T> + Any + Debug,
[src]
T: Copy + PartialEq<T> + Any + Debug,
impl<T, Right> ClosedMul for T where
T: Mul<Right, Output = T> + MulAssign<Right>,
T: Mul<Right, Output = T> + MulAssign<Right>,
impl<T, Right> ClosedAdd for T where
T: Add<Right, Output = T> + AddAssign<Right>,
T: Add<Right, Output = T> + AddAssign<Right>,
impl<T> Same for T
type Output = T
Should always be Self
impl<T, Right> ClosedSub for T where
T: Sub<Right, Output = T> + SubAssign<Right>,
T: Sub<Right, Output = T> + SubAssign<Right>,
impl<T> ClosedNeg for T where
T: Neg<Output = T>,
T: Neg<Output = T>,
impl<T, Right> ClosedDiv for T where
T: Div<Right, Output = T> + DivAssign<Right>,
T: Div<Right, Output = T> + DivAssign<Right>,
impl<SS, SP> SupersetOf for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T> MultiplicativeMonoid for T where
T: AbstractMonoid<Multiplicative> + MultiplicativeSemigroup + One,
T: AbstractMonoid<Multiplicative> + MultiplicativeSemigroup + One,
impl<T> AdditiveGroup for T where
T: AbstractGroup<Additive> + AdditiveLoop + AdditiveMonoid,
T: AbstractGroup<Additive> + AdditiveLoop + AdditiveMonoid,
impl<T> AdditiveMagma for T where
T: AbstractMagma<Additive>,
T: AbstractMagma<Additive>,
impl<T> AdditiveQuasigroup for T where
T: AbstractQuasigroup<Additive> + ClosedSub<T> + AdditiveMagma,
T: AbstractQuasigroup<Additive> + ClosedSub<T> + AdditiveMagma,
impl<T> AdditiveLoop for T where
T: AbstractLoop<Additive> + ClosedNeg + AdditiveQuasigroup + Zero,
T: AbstractLoop<Additive> + ClosedNeg + AdditiveQuasigroup + Zero,
impl<T> AdditiveSemigroup for T where
T: AbstractSemigroup<Additive> + ClosedAdd<T> + AdditiveMagma,
T: AbstractSemigroup<Additive> + ClosedAdd<T> + AdditiveMagma,
impl<T> AdditiveMonoid for T where
T: AbstractMonoid<Additive> + AdditiveSemigroup + Zero,
T: AbstractMonoid<Additive> + AdditiveSemigroup + Zero,
impl<T> AdditiveGroupAbelian for T where
T: AbstractGroupAbelian<Additive> + AdditiveGroup,
T: AbstractGroupAbelian<Additive> + AdditiveGroup,
impl<T> MultiplicativeMagma for T where
T: AbstractMagma<Multiplicative>,
T: AbstractMagma<Multiplicative>,
impl<T> MultiplicativeSemigroup for T where
T: AbstractSemigroup<Multiplicative> + ClosedMul<T> + MultiplicativeMagma,
T: AbstractSemigroup<Multiplicative> + ClosedMul<T> + MultiplicativeMagma,