Struct nalgebra::geometry::QuaternionBase
[−]
[src]
#[repr(C)]pub struct QuaternionBase<N: Real, S: Storage<N, U4, U1>> { pub coords: ColumnVector<N, U4, S>, }
A quaternion. See the type alias UnitQuaternionBase = Unit<QuaternionBase>
for a quaternion
that may be used as a rotation.
Fields
coords: ColumnVector<N, U4, S>
This quaternion as a 4D vector of coordinates in the [ x, y, z, w ]
storage order.
Methods
impl<N, S> QuaternionBase<N, S> where N: Real, S: Storage<N, U4, U1>
[src]
fn into_owned(self) -> OwnedQuaternionBase<N, S::Alloc>
Moves this quaternion into one that owns its data.
fn clone_owned(&self) -> OwnedQuaternionBase<N, S::Alloc>
Clones this quaternion into one that owns its data.
fn vector(&self) -> MatrixSlice<N, U3, U1, S::RStride, S::CStride, S::Alloc>
The vector part (i, j, k)
of this quaternion.
fn scalar(&self) -> N
The scalar part w
of this quaternion.
fn as_vector(&self) -> &ColumnVector<N, U4, S>
Reinterprets this quaternion as a 4D vector.
fn norm(&self) -> N
The norm of this quaternion.
fn norm_squared(&self) -> N
The squared norm of this quaternion.
fn normalize(&self) -> OwnedQuaternionBase<N, S::Alloc>
Normalizes this quaternion.
fn conjugate(&self) -> OwnedQuaternionBase<N, S::Alloc>
Compute the conjugate of this quaternion.
fn try_inverse(&self) -> Option<OwnedQuaternionBase<N, S::Alloc>>
Inverts this quaternion if it is not zero.
fn lerp<S2>(&self,
other: &QuaternionBase<N, S2>,
t: N)
-> OwnedQuaternionBase<N, S::Alloc> where S2: Storage<N, U4, U1>
other: &QuaternionBase<N, S2>,
t: N)
-> OwnedQuaternionBase<N, S::Alloc> where S2: Storage<N, U4, U1>
Linear interpolation between two quaternion.
impl<N, S> QuaternionBase<N, S> where N: Real,
S: Storage<N, U4, U1>,
S::Alloc: Allocator<N, U3, U1>
[src]
S: Storage<N, U4, U1>,
S::Alloc: Allocator<N, U3, U1>
fn polar_decomposition(&self)
-> (N, N, Option<Unit<OwnedColumnVector<N, U3, S::Alloc>>>)
-> (N, N, Option<Unit<OwnedColumnVector<N, U3, S::Alloc>>>)
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
.
fn exp(&self) -> OwnedQuaternionBase<N, S::Alloc>
Compute the exponential of a quaternion.
fn ln(&self) -> OwnedQuaternionBase<N, S::Alloc>
Compute the natural logarithm of a quaternion.
fn powf(&self, n: N) -> OwnedQuaternionBase<N, S::Alloc>
Raise the quaternion to a given floating power.
impl<N, S> QuaternionBase<N, S> where N: Real, S: StorageMut<N, U4, U1>
[src]
fn as_vector_mut(&mut self) -> &mut ColumnVector<N, U4, S>
Transforms this quaternion into its 4D vector form (Vector part, Scalar part).
fn vector_mut(&mut self)
-> MatrixSliceMut<N, U3, U1, S::RStride, S::CStride, S::Alloc>
-> MatrixSliceMut<N, U3, U1, S::RStride, S::CStride, S::Alloc>
The mutable vector part (i, j, k)
of this quaternion.
fn conjugate_mut(&mut self)
Replaces this quaternion by its conjugate.
fn try_inverse_mut(&mut self) -> bool
Inverts this quaternion in-place if it is not zero.
fn normalize_mut(&mut self) -> N
Normalizes this quaternion.
impl<N, S> QuaternionBase<N, S> where N: Real, S: Storage<N, U4, U1>
[src]
fn from_vector(vector: ColumnVector<N, U4, S>) -> Self
Creates a quaternion from a 4D vector. The quaternion scalar part corresponds to the w
vector component.
impl<N, S> QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
fn new(w: N, x: N, y: N, z: N) -> Self
Creates a new quaternion from its individual components. Note that the arguments order does not follow the storage order.
The storage order is [ x, y, z, w ]
.
fn from_parts<SB>(scalar: N, vector: ColumnVector<N, U3, SB>) -> Self where 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 ].
fn from_polar_decomposition<SB>(scale: N,
theta: N,
axis: Unit<ColumnVector<N, U3, SB>>)
-> Self where SB: Storage<N, U3, U1>
theta: N,
axis: Unit<ColumnVector<N, U3, SB>>)
-> Self where SB: Storage<N, U3, U1>
Creates a new quaternion from its polar decomposition.
Note that axis
is assumed to be a unit vector.
fn identity() -> Self
The quaternion multiplicative identity.
Trait Implementations
impl<N: Hash + Real, S: Hash + Storage<N, U4, U1>> Hash for QuaternionBase<N, S>
[src]
fn hash<__HNS: Hasher>(&self, __arg_0: &mut __HNS)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.
impl<N: Debug + Real, S: Debug + Storage<N, U4, U1>> Debug for QuaternionBase<N, S>
[src]
impl<N: Copy + Real, S: Copy + Storage<N, U4, U1>> Copy for QuaternionBase<N, S>
[src]
impl<N: Clone + Real, S: Clone + Storage<N, U4, U1>> Clone for QuaternionBase<N, S>
[src]
fn clone(&self) -> QuaternionBase<N, S>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<N, S> Eq for QuaternionBase<N, S> where N: Real + Eq,
S: Storage<N, U4, U1>
[src]
S: Storage<N, U4, U1>
impl<N, S> PartialEq for QuaternionBase<N, S> where N: Real,
S: Storage<N, U4, U1>
[src]
S: Storage<N, U4, U1>
fn eq(&self, rhs: &Self) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl<N, S> ApproxEq for QuaternionBase<N, S> where N: Real + ApproxEq<Epsilon=N>,
S: Storage<N, U4, U1>
[src]
S: Storage<N, U4, U1>
type Epsilon = N
Used for specifying relative comparisons.
fn default_epsilon() -> Self::Epsilon
The default tolerance to use when testing values that are close together. Read more
fn default_max_relative() -> Self::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
fn default_max_ulps() -> u32
The default ULPs to tolerate when testing values that are far-apart. Read more
fn relative_eq(&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon)
-> bool
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon)
-> bool
A test for equality that uses a relative comparison if the values are far apart.
fn ulps_eq(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
A test for equality that uses units in the last place (ULP) if the values are far apart.
fn relative_ne(&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon)
-> bool
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon)
-> bool
The inverse of ApproxEq::relative_eq
.
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
The inverse of ApproxEq::ulps_eq
.
impl<N, S> Display for QuaternionBase<N, S> where N: Real + Display,
S: Storage<N, U4, U1>
[src]
S: Storage<N, U4, U1>
impl<N, S> One for QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
impl<N, S> Zero for QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
fn zero() -> Self
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
Returns true
if self
is equal to the additive identity.
impl<N, S> Rand for QuaternionBase<N, S> where N: Real + Rand,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
fn rand<R: Rng>(rng: &mut R) -> Self
Generates a random instance of this type using the specified source of randomness. Read more
impl<N, S> Index<usize> for QuaternionBase<N, S> where N: Real,
S: Storage<N, U4, U1>
[src]
S: Storage<N, U4, U1>
type Output = N
The returned type after indexing
fn index(&self, i: usize) -> &N
The method for the indexing (container[index]
) operation
impl<N, S> IndexMut<usize> for QuaternionBase<N, S> where N: Real,
S: StorageMut<N, U4, U1>
[src]
S: StorageMut<N, U4, U1>
fn index_mut(&mut self, i: usize) -> &mut N
The method for the mutable indexing (container[index]
) operation
impl<'a, 'b, N, SA, SB> Add<&'b QuaternionBase<N, SB>> for &'a QuaternionBase<N, SA> where N: Real,
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
[src]
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
type Output = OwnedQuaternionBase<N, SA::Alloc>
The resulting type after applying the +
operator
fn add(self, rhs: &'b QuaternionBase<N, SB>) -> Self::Output
The method for the +
operator
impl<'a, N, SA, SB> Add<QuaternionBase<N, SB>> for &'a QuaternionBase<N, SA> where N: Real,
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
[src]
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
type Output = OwnedQuaternionBase<N, SB::Alloc>
The resulting type after applying the +
operator
fn add(self, rhs: QuaternionBase<N, SB>) -> Self::Output
The method for the +
operator
impl<'b, N, SA, SB> Add<&'b QuaternionBase<N, SB>> for QuaternionBase<N, SA> where N: Real,
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
[src]
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
type Output = OwnedQuaternionBase<N, SA::Alloc>
The resulting type after applying the +
operator
fn add(self, rhs: &'b QuaternionBase<N, SB>) -> Self::Output
The method for the +
operator
impl<N, SA, SB> Add<QuaternionBase<N, SB>> for QuaternionBase<N, SA> where N: Real,
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
[src]
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
type Output = OwnedQuaternionBase<N, SA::Alloc>
The resulting type after applying the +
operator
fn add(self, rhs: QuaternionBase<N, SB>) -> Self::Output
The method for the +
operator
impl<'a, 'b, N, SA, SB> Sub<&'b QuaternionBase<N, SB>> for &'a QuaternionBase<N, SA> where N: Real,
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
[src]
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
type Output = OwnedQuaternionBase<N, SA::Alloc>
The resulting type after applying the -
operator
fn sub(self, rhs: &'b QuaternionBase<N, SB>) -> Self::Output
The method for the -
operator
impl<'a, N, SA, SB> Sub<QuaternionBase<N, SB>> for &'a QuaternionBase<N, SA> where N: Real,
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
[src]
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
type Output = OwnedQuaternionBase<N, SB::Alloc>
The resulting type after applying the -
operator
fn sub(self, rhs: QuaternionBase<N, SB>) -> Self::Output
The method for the -
operator
impl<'b, N, SA, SB> Sub<&'b QuaternionBase<N, SB>> for QuaternionBase<N, SA> where N: Real,
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
[src]
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
type Output = OwnedQuaternionBase<N, SA::Alloc>
The resulting type after applying the -
operator
fn sub(self, rhs: &'b QuaternionBase<N, SB>) -> Self::Output
The method for the -
operator
impl<N, SA, SB> Sub<QuaternionBase<N, SB>> for QuaternionBase<N, SA> where N: Real,
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
[src]
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
type Output = OwnedQuaternionBase<N, SA::Alloc>
The resulting type after applying the -
operator
fn sub(self, rhs: QuaternionBase<N, SB>) -> Self::Output
The method for the -
operator
impl<'a, 'b, N, SA, SB> Mul<&'b QuaternionBase<N, SB>> for &'a QuaternionBase<N, SA> where N: Real,
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
[src]
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
type Output = OwnedQuaternionBase<N, SA::Alloc>
The resulting type after applying the *
operator
fn mul(self, rhs: &'b QuaternionBase<N, SB>) -> Self::Output
The method for the *
operator
impl<'a, N, SA, SB> Mul<QuaternionBase<N, SB>> for &'a QuaternionBase<N, SA> where N: Real,
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
[src]
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
type Output = OwnedQuaternionBase<N, SA::Alloc>
The resulting type after applying the *
operator
fn mul(self, rhs: QuaternionBase<N, SB>) -> Self::Output
The method for the *
operator
impl<'b, N, SA, SB> Mul<&'b QuaternionBase<N, SB>> for QuaternionBase<N, SA> where N: Real,
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
[src]
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
type Output = OwnedQuaternionBase<N, SA::Alloc>
The resulting type after applying the *
operator
fn mul(self, rhs: &'b QuaternionBase<N, SB>) -> Self::Output
The method for the *
operator
impl<N, SA, SB> Mul<QuaternionBase<N, SB>> for QuaternionBase<N, SA> where N: Real,
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
[src]
SA: Storage<N, U4, U1>,
SB: Storage<N, U4, U1>
type Output = OwnedQuaternionBase<N, SA::Alloc>
The resulting type after applying the *
operator
fn mul(self, rhs: QuaternionBase<N, SB>) -> Self::Output
The method for the *
operator
impl<N, S> Mul<N> for QuaternionBase<N, S> where N: Real, S: Storage<N, U4, U1>
[src]
type Output = OwnedQuaternionBase<N, S::Alloc>
The resulting type after applying the *
operator
fn mul(self, n: N) -> Self::Output
The method for the *
operator
impl<'a, N, S> Mul<N> for &'a QuaternionBase<N, S> where N: Real,
S: Storage<N, U4, U1>
[src]
S: Storage<N, U4, U1>
type Output = OwnedQuaternionBase<N, S::Alloc>
The resulting type after applying the *
operator
fn mul(self, n: N) -> Self::Output
The method for the *
operator
impl<N, S> MulAssign<N> for QuaternionBase<N, S> where N: Real,
S: StorageMut<N, U4, U1>
[src]
S: StorageMut<N, U4, U1>
fn mul_assign(&mut self, n: N)
The method for the *=
operator
impl<N, S> Div<N> for QuaternionBase<N, S> where N: Real, S: Storage<N, U4, U1>
[src]
type Output = OwnedQuaternionBase<N, S::Alloc>
The resulting type after applying the /
operator
fn div(self, n: N) -> Self::Output
The method for the /
operator
impl<'a, N, S> Div<N> for &'a QuaternionBase<N, S> where N: Real,
S: Storage<N, U4, U1>
[src]
S: Storage<N, U4, U1>
type Output = OwnedQuaternionBase<N, S::Alloc>
The resulting type after applying the /
operator
fn div(self, n: N) -> Self::Output
The method for the /
operator
impl<N, S> DivAssign<N> for QuaternionBase<N, S> where N: Real,
S: StorageMut<N, U4, U1>
[src]
S: StorageMut<N, U4, U1>
fn div_assign(&mut self, n: N)
The method for the /=
operator
impl<N, S> Neg for QuaternionBase<N, S> where N: Real, S: Storage<N, U4, U1>
[src]
type Output = OwnedQuaternionBase<N, S::Alloc>
The resulting type after applying the -
operator
fn neg(self) -> Self::Output
The method for the unary -
operator
impl<'a, N, S> Neg for &'a QuaternionBase<N, S> where N: Real,
S: Storage<N, U4, U1>
[src]
S: Storage<N, U4, U1>
type Output = OwnedQuaternionBase<N, S::Alloc>
The resulting type after applying the -
operator
fn neg(self) -> Self::Output
The method for the unary -
operator
impl<'b, N, SA, SB> AddAssign<&'b QuaternionBase<N, SB>> for QuaternionBase<N, SA> where N: Real,
SA: StorageMut<N, U4, U1>,
SB: Storage<N, U4, U1>
[src]
SA: StorageMut<N, U4, U1>,
SB: Storage<N, U4, U1>
fn add_assign(&mut self, rhs: &'b QuaternionBase<N, SB>)
The method for the +=
operator
impl<N, SA, SB> AddAssign<QuaternionBase<N, SB>> for QuaternionBase<N, SA> where N: Real,
SA: StorageMut<N, U4, U1>,
SB: Storage<N, U4, U1>
[src]
SA: StorageMut<N, U4, U1>,
SB: Storage<N, U4, U1>
fn add_assign(&mut self, rhs: QuaternionBase<N, SB>)
The method for the +=
operator
impl<'b, N, SA, SB> SubAssign<&'b QuaternionBase<N, SB>> for QuaternionBase<N, SA> where N: Real,
SA: StorageMut<N, U4, U1>,
SB: Storage<N, U4, U1>
[src]
SA: StorageMut<N, U4, U1>,
SB: Storage<N, U4, U1>
fn sub_assign(&mut self, rhs: &'b QuaternionBase<N, SB>)
The method for the -=
operator
impl<N, SA, SB> SubAssign<QuaternionBase<N, SB>> for QuaternionBase<N, SA> where N: Real,
SA: StorageMut<N, U4, U1>,
SB: Storage<N, U4, U1>
[src]
SA: StorageMut<N, U4, U1>,
SB: Storage<N, U4, U1>
fn sub_assign(&mut self, rhs: QuaternionBase<N, SB>)
The method for the -=
operator
impl<'b, N, SA, SB> MulAssign<&'b QuaternionBase<N, SB>> for QuaternionBase<N, SA> where N: Real,
SA: StorageMut<N, U4, U1>,
SB: Storage<N, U4, U1>
[src]
SA: StorageMut<N, U4, U1>,
SB: Storage<N, U4, U1>
fn mul_assign(&mut self, rhs: &'b QuaternionBase<N, SB>)
The method for the *=
operator
impl<N, SA, SB> MulAssign<QuaternionBase<N, SB>> for QuaternionBase<N, SA> where N: Real,
SA: StorageMut<N, U4, U1>,
SB: Storage<N, U4, U1>
[src]
SA: StorageMut<N, U4, U1>,
SB: Storage<N, U4, U1>
fn mul_assign(&mut self, rhs: QuaternionBase<N, SB>)
The method for the *=
operator
impl<N, S> Identity<Multiplicative> for QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
fn identity() -> Self
The identity element.
impl<N, S> Identity<Additive> for QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
fn identity() -> Self
The identity element.
impl<N, S> AbstractMagma<Multiplicative> for QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
fn operate(&self, rhs: &Self) -> Self
Performs an operation.
fn op(&self, O, lhs: &Self) -> Self
Performs specific operation.
impl<N, S> AbstractMagma<Additive> for QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
fn operate(&self, rhs: &Self) -> Self
Performs an operation.
fn op(&self, O, lhs: &Self) -> Self
Performs specific operation.
impl<N, S> Inverse<Additive> for QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
fn inverse(&self) -> Self
Returns the inverse of self
, relative to the operator O
.
fn inverse_mut(&mut self)
In-place inversin of self
.
impl<N, S> AbstractSemigroup<Multiplicative> for QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
fn prop_is_associative_approx(args: (Self, Self, Self)) -> bool where Self: ApproxEq
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
Returns true
if associativity holds for the given arguments.
impl<N, S> AbstractMonoid<Multiplicative> for QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
fn prop_operating_identity_element_is_noop_approx(a: Self) -> bool where Self: ApproxEq
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(a: Self) -> bool where Self: Eq
Checks whether operating with the identity element is a no-op for the given argument. Read more
impl<N, S> AbstractSemigroup<Additive> for QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
fn prop_is_associative_approx(args: (Self, Self, Self)) -> bool where Self: ApproxEq
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
Returns true
if associativity holds for the given arguments.
impl<N, S> AbstractQuasigroup<Additive> for QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
fn prop_inv_is_latin_square_approx(args: (Self, Self)) -> bool where Self: ApproxEq
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
Returns true
if latin squareness holds for the given arguments.
impl<N, S> AbstractMonoid<Additive> for QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
fn prop_operating_identity_element_is_noop_approx(a: Self) -> bool where Self: ApproxEq
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(a: Self) -> bool where Self: Eq
Checks whether operating with the identity element is a no-op for the given argument. Read more
impl<N, S> AbstractLoop<Additive> for QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
impl<N, S> AbstractGroup<Additive> for QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
impl<N, S> AbstractGroupAbelian<Additive> for QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
fn prop_is_commutative_approx(args: (Self, Self)) -> bool where Self: ApproxEq
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
Returns true
if the operator is commutative for the given argument tuple.
impl<N, S> AbstractModule for QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
type AbstractRing = N
The underlying scalar field.
fn multiply_by(&self, n: N) -> Self
Multiplies an element of the ring with an element of the module.
impl<N, S> Module for QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
type Ring = N
The underlying scalar field.
impl<N, S> VectorSpace for QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
type Field = N
The underlying scalar field.
impl<N, S> FiniteDimVectorSpace for QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
fn dimension() -> usize
The vector space dimension.
fn canonical_basis_element(i: usize) -> Self
The i-the canonical basis element.
fn dot(&self, other: &Self) -> N
The dot product between two vectors.
unsafe fn component_unchecked(&self, i: usize) -> &N
Same as &self[i]
but without bound-checking.
unsafe fn component_unchecked_mut(&mut self, i: usize) -> &mut N
Same as &mut self[i]
but without bound-checking.
fn canonical_basis<F>(f: F) where 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, S> NormedSpace for QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
fn norm_squared(&self) -> N
The squared norm of this vector.
fn norm(&self) -> N
The norm of this vector.
fn normalize(&self) -> Self
Returns a normalized version of this vector.
fn normalize_mut(&mut self) -> N
Normalizes this vector in-place and returns its norm.
fn try_normalize(&self, min_norm: N) -> Option<Self>
Returns a normalized version of this vector unless its norm as smaller or equal to eps
.
fn try_normalize_mut(&mut self, min_norm: N) -> Option<N>
Normalizes this vector in-place or does nothing if its norm is smaller or equal to eps
. Read more
impl<N, S> Deref for QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
type Target = IJKW<N>
The resulting type after dereferencing
fn deref(&self) -> &Self::Target
The method called to dereference a value
impl<N, S> DerefMut for QuaternionBase<N, S> where N: Real,
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
[src]
S: OwnedStorage<N, U4, U1>,
S::Alloc: OwnedAllocator<N, U4, U1, S>
impl<N1, N2, SA, SB> SubsetOf<QuaternionBase<N2, SB>> for QuaternionBase<N1, SA> where N1: Real,
N2: Real + SupersetOf<N1>,
SA: OwnedStorage<N1, U4, U1>,
SB: OwnedStorage<N2, U4, U1>,
SA::Alloc: OwnedAllocator<N1, U4, U1, SA>,
SB::Alloc: OwnedAllocator<N2, U4, U1, SB>
[src]
N2: Real + SupersetOf<N1>,
SA: OwnedStorage<N1, U4, U1>,
SB: OwnedStorage<N2, U4, U1>,
SA::Alloc: OwnedAllocator<N1, U4, U1, SA>,
SB::Alloc: OwnedAllocator<N2, U4, U1, SB>
fn to_superset(&self) -> QuaternionBase<N2, SB>
The inclusion map: converts self
to the equivalent element of its superset.
fn is_in_subset(q: &QuaternionBase<N2, SB>) -> bool
Checks if element
is actually part of the subset Self
(and can be converted to it).
unsafe fn from_superset_unchecked(q: &QuaternionBase<N2, SB>) -> Self
Use with care! Same as self.to_superset
but without any property checks. Always succeeds.
fn from_superset(element: &T) -> Option<Self>
The inverse inclusion map: attempts to construct self
from the equivalent element of its superset. Read more