#[repr(transparent)]pub struct Unit<T> { /* private fields */ }
Expand description
A wrapper that ensures the underlying algebraic entity has a unit norm.
Use .as_ref()
or .unwrap()
to obtain the underlying value by-reference or by-move.
Implementations§
source§impl<N: Real, D: Dim, S: Storage<N, D>> Unit<Vector<N, D, S>>
impl<N: Real, D: Dim, S: Storage<N, D>> Unit<Vector<N, D, S>>
sourcepub fn slerp<S2: Storage<N, D>>(
&self,
rhs: &Unit<Vector<N, D, S2>>,
t: N
) -> Unit<VectorN<N, D>>where
DefaultAllocator: Allocator<N, D>,
pub fn slerp<S2: Storage<N, D>>(
&self,
rhs: &Unit<Vector<N, D, S2>>,
t: N
) -> Unit<VectorN<N, D>>where
DefaultAllocator: Allocator<N, D>,
Computes the spherical linear interpolation between two unit vectors.
sourcepub fn try_slerp<S2: Storage<N, D>>(
&self,
rhs: &Unit<Vector<N, D, S2>>,
t: N,
epsilon: N
) -> Option<Unit<VectorN<N, D>>>where
DefaultAllocator: Allocator<N, D>,
pub fn try_slerp<S2: Storage<N, D>>(
&self,
rhs: &Unit<Vector<N, D, S2>>,
t: N,
epsilon: N
) -> Option<Unit<VectorN<N, D>>>where
DefaultAllocator: Allocator<N, D>,
Computes the spherical linear interpolation between two unit vectors.
Returns None
if the two vectors are almost collinear and with opposite direction
(in this case, there is an infinity of possible results).
source§impl<T: NormedSpace> Unit<T>
impl<T: NormedSpace> Unit<T>
sourcepub fn new_normalize(value: T) -> Self
pub fn new_normalize(value: T) -> Self
Normalize the given value and return it wrapped on a Unit
structure.
sourcepub fn try_new(value: T, min_norm: T::Field) -> Option<Self>
pub fn try_new(value: T, min_norm: T::Field) -> Option<Self>
Attempts to normalize the given value and return it wrapped on a Unit
structure.
Returns None
if the norm was smaller or equal to min_norm
.
sourcepub fn new_and_get(value: T) -> (Self, T::Field)
pub fn new_and_get(value: T) -> (Self, T::Field)
Normalize the given value and return it wrapped on a Unit
structure and its norm.
sourcepub fn try_new_and_get(value: T, min_norm: T::Field) -> Option<(Self, T::Field)>
pub fn try_new_and_get(value: T, min_norm: T::Field) -> Option<(Self, T::Field)>
Normalize the given value and return it wrapped on a Unit
structure and its norm.
Returns None
if the norm was smaller or equal to min_norm
.
sourcepub fn renormalize(&mut self) -> T::Field
pub fn renormalize(&mut self) -> T::Field
Normalizes this value again. This is useful when repeated computations might cause a drift in the norm because of float inaccuracies.
Returns the norm before re-normalization (should be close to 1.0
).
source§impl<T> Unit<T>
impl<T> Unit<T>
sourcepub fn new_unchecked(value: T) -> Self
pub fn new_unchecked(value: T) -> Self
Wraps the given value, assuming it is already normalized.
sourcepub fn from_ref_unchecked<'a>(value: &'a T) -> &'a Self
pub fn from_ref_unchecked<'a>(value: &'a T) -> &'a Self
Wraps the given reference, assuming it is already normalized.
sourcepub fn as_mut_unchecked(&mut self) -> &mut T
pub fn as_mut_unchecked(&mut self) -> &mut T
Returns a mutable reference to the underlying value. This is _unchecked
because modifying
the underlying value in such a way that it no longer has unit length may lead to unexpected
results.
source§impl<N: Real> Unit<Quaternion<N>>
impl<N: Real> Unit<Quaternion<N>>
sourcepub fn into_owned(self) -> UnitQuaternion<N>
👎Deprecated: This method is unnecessary and will be removed in a future release. Use .clone()
instead.
pub fn into_owned(self) -> UnitQuaternion<N>
.clone()
instead.Moves this unit quaternion into one that owns its data.
sourcepub fn clone_owned(&self) -> UnitQuaternion<N>
👎Deprecated: This method is unnecessary and will be removed in a future release. Use .clone()
instead.
pub fn clone_owned(&self) -> UnitQuaternion<N>
.clone()
instead.Clones this unit quaternion into one that owns its data.
sourcepub fn angle(&self) -> N
pub fn angle(&self) -> N
The rotation angle in [0; pi] of this unit quaternion.
Example
let axis = Unit::new_normalize(Vector3::new(1.0, 2.0, 3.0));
let rot = UnitQuaternion::from_axis_angle(&axis, 1.78);
assert_eq!(rot.angle(), 1.78);
sourcepub fn quaternion(&self) -> &Quaternion<N>
pub fn quaternion(&self) -> &Quaternion<N>
The underlying quaternion.
Same as self.as_ref()
.
Example
let axis = UnitQuaternion::identity();
assert_eq!(*axis.quaternion(), Quaternion::new(1.0, 0.0, 0.0, 0.0));
sourcepub fn conjugate(&self) -> UnitQuaternion<N>
pub fn conjugate(&self) -> UnitQuaternion<N>
Compute the conjugate of this unit quaternion.
Example
let axis = Unit::new_normalize(Vector3::new(1.0, 2.0, 3.0));
let rot = UnitQuaternion::from_axis_angle(&axis, 1.78);
let conj = rot.conjugate();
assert_eq!(conj, UnitQuaternion::from_axis_angle(&-axis, 1.78));
sourcepub fn inverse(&self) -> UnitQuaternion<N>
pub fn inverse(&self) -> UnitQuaternion<N>
Inverts this quaternion if it is not zero.
Example
let axis = Unit::new_normalize(Vector3::new(1.0, 2.0, 3.0));
let rot = UnitQuaternion::from_axis_angle(&axis, 1.78);
let inv = rot.inverse();
assert_eq!(rot * inv, UnitQuaternion::identity());
assert_eq!(inv * rot, UnitQuaternion::identity());
sourcepub fn angle_to(&self, other: &UnitQuaternion<N>) -> N
pub fn angle_to(&self, other: &UnitQuaternion<N>) -> N
The rotation angle needed to make self
and other
coincide.
Example
let rot1 = UnitQuaternion::from_axis_angle(&Vector3::y_axis(), 1.0);
let rot2 = UnitQuaternion::from_axis_angle(&Vector3::x_axis(), 0.1);
assert_relative_eq!(rot1.angle_to(&rot2), 1.0045657, epsilon = 1.0e-6);
sourcepub fn rotation_to(&self, other: &UnitQuaternion<N>) -> UnitQuaternion<N>
pub fn rotation_to(&self, other: &UnitQuaternion<N>) -> UnitQuaternion<N>
The unit quaternion needed to make self
and other
coincide.
The result is such that: self.rotation_to(other) * self == other
.
Example
let rot1 = UnitQuaternion::from_axis_angle(&Vector3::y_axis(), 1.0);
let rot2 = UnitQuaternion::from_axis_angle(&Vector3::x_axis(), 0.1);
let rot_to = rot1.rotation_to(&rot2);
assert_relative_eq!(rot_to * rot1, rot2, epsilon = 1.0e-6);
sourcepub fn lerp(&self, other: &UnitQuaternion<N>, t: N) -> Quaternion<N>
pub fn lerp(&self, other: &UnitQuaternion<N>, t: N) -> Quaternion<N>
Linear interpolation between two unit quaternions.
The result is not normalized.
Example
let q1 = UnitQuaternion::new_normalize(Quaternion::new(1.0, 0.0, 0.0, 0.0));
let q2 = UnitQuaternion::new_normalize(Quaternion::new(0.0, 1.0, 0.0, 0.0));
assert_eq!(q1.lerp(&q2, 0.1), Quaternion::new(0.9, 0.1, 0.0, 0.0));
sourcepub fn nlerp(&self, other: &UnitQuaternion<N>, t: N) -> UnitQuaternion<N>
pub fn nlerp(&self, other: &UnitQuaternion<N>, t: N) -> UnitQuaternion<N>
Normalized linear interpolation between two unit quaternions.
This is the same as self.lerp
except that the result is normalized.
Example
let q1 = UnitQuaternion::new_normalize(Quaternion::new(1.0, 0.0, 0.0, 0.0));
let q2 = UnitQuaternion::new_normalize(Quaternion::new(0.0, 1.0, 0.0, 0.0));
assert_eq!(q1.nlerp(&q2, 0.1), UnitQuaternion::new_normalize(Quaternion::new(0.9, 0.1, 0.0, 0.0)));
sourcepub fn slerp(&self, other: &UnitQuaternion<N>, t: N) -> UnitQuaternion<N>
pub fn slerp(&self, other: &UnitQuaternion<N>, t: N) -> UnitQuaternion<N>
Spherical linear interpolation between two unit quaternions.
Panics if the angle between both quaternion is 180 degrees (in which case the interpolation
is not well-defined). Use .try_slerp
instead to avoid the panic.
sourcepub fn try_slerp(
&self,
other: &UnitQuaternion<N>,
t: N,
epsilon: N
) -> Option<UnitQuaternion<N>>
pub fn try_slerp(
&self,
other: &UnitQuaternion<N>,
t: N,
epsilon: N
) -> Option<UnitQuaternion<N>>
Computes the spherical linear interpolation between two unit quaternions or returns None
if both quaternions are approximately 180 degrees apart (in which case the interpolation is
not well-defined).
Arguments
self
: the first quaternion to interpolate from.other
: the second quaternion to interpolate toward.t
: the interpolation parameter. Should be between 0 and 1.epsilon
: the value below which the sinus of the angle separating both quaternion must be to returnNone
.
sourcepub fn conjugate_mut(&mut self)
pub fn conjugate_mut(&mut self)
Compute the conjugate of this unit quaternion in-place.
sourcepub fn inverse_mut(&mut self)
pub fn inverse_mut(&mut self)
Inverts this quaternion if it is not zero.
Example
let axisangle = Vector3::new(0.1, 0.2, 0.3);
let mut rot = UnitQuaternion::new(axisangle);
rot.inverse_mut();
assert_relative_eq!(rot * UnitQuaternion::new(axisangle), UnitQuaternion::identity());
assert_relative_eq!(UnitQuaternion::new(axisangle) * rot, UnitQuaternion::identity());
sourcepub fn axis(&self) -> Option<Unit<Vector3<N>>>
pub fn axis(&self) -> Option<Unit<Vector3<N>>>
The rotation axis of this unit quaternion or None
if the rotation is zero.
Example
let axis = Unit::new_normalize(Vector3::new(1.0, 2.0, 3.0));
let angle = 1.2;
let rot = UnitQuaternion::from_axis_angle(&axis, angle);
assert_eq!(rot.axis(), Some(axis));
// Case with a zero angle.
let rot = UnitQuaternion::from_axis_angle(&axis, 0.0);
assert!(rot.axis().is_none());
sourcepub fn scaled_axis(&self) -> Vector3<N>
pub fn scaled_axis(&self) -> Vector3<N>
The rotation axis of this unit quaternion multiplied by the rotation angle.
Example
let axisangle = Vector3::new(0.1, 0.2, 0.3);
let rot = UnitQuaternion::new(axisangle);
assert_relative_eq!(rot.scaled_axis(), axisangle, epsilon = 1.0e-6);
sourcepub fn axis_angle(&self) -> Option<(Unit<Vector3<N>>, N)>
pub fn axis_angle(&self) -> Option<(Unit<Vector3<N>>, N)>
The rotation axis and angle in ]0, pi] of this unit quaternion.
Returns None
if the angle is zero.
Example
let axis = Unit::new_normalize(Vector3::new(1.0, 2.0, 3.0));
let angle = 1.2;
let rot = UnitQuaternion::from_axis_angle(&axis, angle);
assert_eq!(rot.axis_angle(), Some((axis, angle)));
// Case with a zero angle.
let rot = UnitQuaternion::from_axis_angle(&axis, 0.0);
assert!(rot.axis_angle().is_none());
sourcepub fn exp(&self) -> Quaternion<N>
pub fn exp(&self) -> Quaternion<N>
Compute the exponential of a quaternion.
Note that this function yields a Quaternion<N>
because it looses the unit property.
sourcepub fn ln(&self) -> Quaternion<N>
pub fn ln(&self) -> Quaternion<N>
Compute the natural logarithm of a quaternion.
Note that this function yields a Quaternion<N>
because it looses the unit property.
The vector part of the return value corresponds to the axis-angle representation (divided
by 2.0) of this unit quaternion.
Example
let axisangle = Vector3::new(0.1, 0.2, 0.3);
let q = UnitQuaternion::new(axisangle);
assert_relative_eq!(q.ln().vector().into_owned(), axisangle, epsilon = 1.0e-6);
sourcepub fn powf(&self, n: N) -> UnitQuaternion<N>
pub fn powf(&self, n: N) -> UnitQuaternion<N>
Raise the quaternion to a given floating power.
This returns the unit quaternion that identifies a rotation with axis self.axis()
and
angle self.angle() × n
.
Example
let axis = Unit::new_normalize(Vector3::new(1.0, 2.0, 3.0));
let angle = 1.2;
let rot = UnitQuaternion::from_axis_angle(&axis, angle);
let pow = rot.powf(2.0);
assert_relative_eq!(pow.axis().unwrap(), axis, epsilon = 1.0e-6);
assert_eq!(pow.angle(), 2.4);
sourcepub fn to_rotation_matrix(&self) -> Rotation<N, U3>
pub fn to_rotation_matrix(&self) -> Rotation<N, U3>
Builds a rotation matrix from this unit quaternion.
Example
let q = UnitQuaternion::from_axis_angle(&Vector3::z_axis(), f32::consts::FRAC_PI_6);
let rot = q.to_rotation_matrix();
let expected = Matrix3::new(0.8660254, -0.5, 0.0,
0.5, 0.8660254, 0.0,
0.0, 0.0, 1.0);
assert_relative_eq!(*rot.matrix(), expected, epsilon = 1.0e-6);
sourcepub fn to_euler_angles(&self) -> (N, N, N)
👎Deprecated: This is renamed to use .euler_angles()
.
pub fn to_euler_angles(&self) -> (N, N, N)
.euler_angles()
.Converts this unit quaternion into its equivalent Euler angles.
The angles are produced in the form (roll, pitch, yaw).
sourcepub fn euler_angles(&self) -> (N, N, N)
pub fn euler_angles(&self) -> (N, N, N)
Retrieves the euler angles corresponding to this unit quaternion.
The angles are produced in the form (roll, pitch, yaw).
Example
let rot = UnitQuaternion::from_euler_angles(0.1, 0.2, 0.3);
let euler = rot.euler_angles();
assert_relative_eq!(euler.0, 0.1, epsilon = 1.0e-6);
assert_relative_eq!(euler.1, 0.2, epsilon = 1.0e-6);
assert_relative_eq!(euler.2, 0.3, epsilon = 1.0e-6);
sourcepub fn to_homogeneous(&self) -> MatrixN<N, U4>
pub fn to_homogeneous(&self) -> MatrixN<N, U4>
Converts this unit quaternion into its equivalent homogeneous transformation matrix.
Example
let rot = UnitQuaternion::from_axis_angle(&Vector3::z_axis(), f32::consts::FRAC_PI_6);
let expected = Matrix4::new(0.8660254, -0.5, 0.0, 0.0,
0.5, 0.8660254, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0);
assert_relative_eq!(rot.to_homogeneous(), expected, epsilon = 1.0e-6);
source§impl<N: Real> Unit<Quaternion<N>>
impl<N: Real> Unit<Quaternion<N>>
sourcepub fn identity() -> Self
pub fn identity() -> Self
The rotation identity.
Example
let q = UnitQuaternion::identity();
let q2 = UnitQuaternion::new(Vector3::new(1.0, 2.0, 3.0));
let v = Vector3::new_random();
let p = Point3::from(v);
assert_eq!(q * q2, q2);
assert_eq!(q2 * q, q2);
assert_eq!(q * v, v);
assert_eq!(q * p, p);
sourcepub fn from_axis_angle<SB>(axis: &Unit<Vector<N, U3, SB>>, angle: N) -> Selfwhere
SB: Storage<N, U3>,
pub fn from_axis_angle<SB>(axis: &Unit<Vector<N, U3, SB>>, angle: N) -> Selfwhere
SB: Storage<N, U3>,
Creates a new quaternion from a unit vector (the rotation axis) and an angle (the rotation angle).
Example
let axis = Vector3::y_axis();
let angle = f32::consts::FRAC_PI_2;
// Point and vector being transformed in the tests.
let pt = Point3::new(4.0, 5.0, 6.0);
let vec = Vector3::new(4.0, 5.0, 6.0);
let q = UnitQuaternion::from_axis_angle(&axis, angle);
assert_eq!(q.axis().unwrap(), axis);
assert_eq!(q.angle(), angle);
assert_relative_eq!(q * pt, Point3::new(6.0, 5.0, -4.0), epsilon = 1.0e-6);
assert_relative_eq!(q * vec, Vector3::new(6.0, 5.0, -4.0), epsilon = 1.0e-6);
// A zero vector yields an identity.
assert_eq!(UnitQuaternion::from_scaled_axis(Vector3::<f32>::zeros()), UnitQuaternion::identity());
sourcepub fn from_quaternion(q: Quaternion<N>) -> Self
pub fn from_quaternion(q: Quaternion<N>) -> Self
Creates a new unit quaternion from a quaternion.
The input quaternion will be normalized.
sourcepub fn from_euler_angles(roll: N, pitch: N, yaw: N) -> Self
pub fn from_euler_angles(roll: N, pitch: N, yaw: N) -> Self
Creates a new unit quaternion from Euler angles.
The primitive rotations are applied in order: 1 roll − 2 pitch − 3 yaw.
Example
let rot = UnitQuaternion::from_euler_angles(0.1, 0.2, 0.3);
let euler = rot.euler_angles();
assert_relative_eq!(euler.0, 0.1, epsilon = 1.0e-6);
assert_relative_eq!(euler.1, 0.2, epsilon = 1.0e-6);
assert_relative_eq!(euler.2, 0.3, epsilon = 1.0e-6);
sourcepub fn from_rotation_matrix(rotmat: &Rotation<N, U3>) -> Self
pub fn from_rotation_matrix(rotmat: &Rotation<N, U3>) -> Self
Builds an unit quaternion from a rotation matrix.
Example
let axis = Vector3::y_axis();
let angle = 0.1;
let rot = Rotation3::from_axis_angle(&axis, angle);
let q = UnitQuaternion::from_rotation_matrix(&rot);
assert_relative_eq!(q.to_rotation_matrix(), rot, epsilon = 1.0e-6);
assert_relative_eq!(q.axis().unwrap(), rot.axis().unwrap(), epsilon = 1.0e-6);
assert_relative_eq!(q.angle(), rot.angle(), epsilon = 1.0e-6);
sourcepub fn rotation_between<SB, SC>(
a: &Vector<N, U3, SB>,
b: &Vector<N, U3, SC>
) -> Option<Self>where
SB: Storage<N, U3>,
SC: Storage<N, U3>,
pub fn rotation_between<SB, SC>(
a: &Vector<N, U3, SB>,
b: &Vector<N, U3, SC>
) -> Option<Self>where
SB: Storage<N, U3>,
SC: Storage<N, U3>,
The unit quaternion needed to make a
and b
be collinear and point toward the same
direction.
Example
let a = Vector3::new(1.0, 2.0, 3.0);
let b = Vector3::new(3.0, 1.0, 2.0);
let q = UnitQuaternion::rotation_between(&a, &b).unwrap();
assert_relative_eq!(q * a, b);
assert_relative_eq!(q.inverse() * b, a);
sourcepub fn scaled_rotation_between<SB, SC>(
a: &Vector<N, U3, SB>,
b: &Vector<N, U3, SC>,
s: N
) -> Option<Self>where
SB: Storage<N, U3>,
SC: Storage<N, U3>,
pub fn scaled_rotation_between<SB, SC>(
a: &Vector<N, U3, SB>,
b: &Vector<N, U3, SC>,
s: N
) -> Option<Self>where
SB: Storage<N, U3>,
SC: Storage<N, U3>,
The smallest rotation needed to make a
and b
collinear and point toward the same
direction, raised to the power s
.
Example
let a = Vector3::new(1.0, 2.0, 3.0);
let b = Vector3::new(3.0, 1.0, 2.0);
let q2 = UnitQuaternion::scaled_rotation_between(&a, &b, 0.2).unwrap();
let q5 = UnitQuaternion::scaled_rotation_between(&a, &b, 0.5).unwrap();
assert_relative_eq!(q2 * q2 * q2 * q2 * q2 * a, b, epsilon = 1.0e-6);
assert_relative_eq!(q5 * q5 * a, b, epsilon = 1.0e-6);
sourcepub fn rotation_between_axis<SB, SC>(
a: &Unit<Vector<N, U3, SB>>,
b: &Unit<Vector<N, U3, SC>>
) -> Option<Self>where
SB: Storage<N, U3>,
SC: Storage<N, U3>,
pub fn rotation_between_axis<SB, SC>(
a: &Unit<Vector<N, U3, SB>>,
b: &Unit<Vector<N, U3, SC>>
) -> Option<Self>where
SB: Storage<N, U3>,
SC: Storage<N, U3>,
The unit quaternion needed to make a
and b
be collinear and point toward the same
direction.
Example
let a = Unit::new_normalize(Vector3::new(1.0, 2.0, 3.0));
let b = Unit::new_normalize(Vector3::new(3.0, 1.0, 2.0));
let q = UnitQuaternion::rotation_between(&a, &b).unwrap();
assert_relative_eq!(q * a, b);
assert_relative_eq!(q.inverse() * b, a);
sourcepub fn scaled_rotation_between_axis<SB, SC>(
na: &Unit<Vector<N, U3, SB>>,
nb: &Unit<Vector<N, U3, SC>>,
s: N
) -> Option<Self>where
SB: Storage<N, U3>,
SC: Storage<N, U3>,
pub fn scaled_rotation_between_axis<SB, SC>(
na: &Unit<Vector<N, U3, SB>>,
nb: &Unit<Vector<N, U3, SC>>,
s: N
) -> Option<Self>where
SB: Storage<N, U3>,
SC: Storage<N, U3>,
The smallest rotation needed to make a
and b
collinear and point toward the same
direction, raised to the power s
.
Example
let a = Unit::new_normalize(Vector3::new(1.0, 2.0, 3.0));
let b = Unit::new_normalize(Vector3::new(3.0, 1.0, 2.0));
let q2 = UnitQuaternion::scaled_rotation_between(&a, &b, 0.2).unwrap();
let q5 = UnitQuaternion::scaled_rotation_between(&a, &b, 0.5).unwrap();
assert_relative_eq!(q2 * q2 * q2 * q2 * q2 * a, b, epsilon = 1.0e-6);
assert_relative_eq!(q5 * q5 * a, b, epsilon = 1.0e-6);
sourcepub fn new_observer_frame<SB, SC>(
dir: &Vector<N, U3, SB>,
up: &Vector<N, U3, SC>
) -> Selfwhere
SB: Storage<N, U3>,
SC: Storage<N, U3>,
pub fn new_observer_frame<SB, SC>(
dir: &Vector<N, U3, SB>,
up: &Vector<N, U3, SC>
) -> Selfwhere
SB: Storage<N, U3>,
SC: Storage<N, U3>,
Creates an unit quaternion that corresponds to the local frame of an observer standing at the
origin and looking toward dir
.
It maps the z
axis to the direction dir
.
Arguments
- dir - The look direction. It does not need to be normalized.
- up - The vertical direction. It does not need to be normalized.
The only requirement of this parameter is to not be collinear to
dir
. Non-collinearity is not checked.
Example
let dir = Vector3::new(1.0, 2.0, 3.0);
let up = Vector3::y();
let q = UnitQuaternion::new_observer_frame(&dir, &up);
assert_relative_eq!(q * Vector3::z(), dir.normalize());
sourcepub fn look_at_rh<SB, SC>(
dir: &Vector<N, U3, SB>,
up: &Vector<N, U3, SC>
) -> Selfwhere
SB: Storage<N, U3>,
SC: Storage<N, U3>,
pub fn look_at_rh<SB, SC>(
dir: &Vector<N, U3, SB>,
up: &Vector<N, U3, SC>
) -> Selfwhere
SB: Storage<N, U3>,
SC: Storage<N, U3>,
Builds a right-handed look-at view matrix without translation.
It maps the view direction dir
to the negative z
axis.
This conforms to the common notion of right handed look-at matrix from the computer
graphics community.
Arguments
- dir − The view direction. It does not need to be normalized.
- up - A vector approximately aligned with required the vertical axis. It does not need
to be normalized. The only requirement of this parameter is to not be collinear to
dir
.
Example
let dir = Vector3::new(1.0, 2.0, 3.0);
let up = Vector3::y();
let q = UnitQuaternion::look_at_rh(&dir, &up);
assert_relative_eq!(q * dir.normalize(), -Vector3::z());
sourcepub fn look_at_lh<SB, SC>(
dir: &Vector<N, U3, SB>,
up: &Vector<N, U3, SC>
) -> Selfwhere
SB: Storage<N, U3>,
SC: Storage<N, U3>,
pub fn look_at_lh<SB, SC>(
dir: &Vector<N, U3, SB>,
up: &Vector<N, U3, SC>
) -> Selfwhere
SB: Storage<N, U3>,
SC: Storage<N, U3>,
Builds a left-handed look-at view matrix without translation.
It maps the view direction dir
to the positive z
axis.
This conforms to the common notion of left handed look-at matrix from the computer
graphics community.
Arguments
- dir − The view direction. It does not need to be normalized.
- up - A vector approximately aligned with required the vertical axis. The only
requirement of this parameter is to not be collinear to
dir
.
Example
let dir = Vector3::new(1.0, 2.0, 3.0);
let up = Vector3::y();
let q = UnitQuaternion::look_at_lh(&dir, &up);
assert_relative_eq!(q * dir.normalize(), Vector3::z());
sourcepub fn new<SB>(axisangle: Vector<N, U3, SB>) -> Selfwhere
SB: Storage<N, U3>,
pub fn new<SB>(axisangle: Vector<N, U3, SB>) -> Selfwhere
SB: Storage<N, U3>,
Creates a new unit quaternion rotation from a rotation axis scaled by the rotation angle.
If axisangle
has a magnitude smaller than N::default_epsilon()
, this returns the identity rotation.
Example
let axisangle = Vector3::y() * f32::consts::FRAC_PI_2;
// Point and vector being transformed in the tests.
let pt = Point3::new(4.0, 5.0, 6.0);
let vec = Vector3::new(4.0, 5.0, 6.0);
let q = UnitQuaternion::new(axisangle);
assert_relative_eq!(q * pt, Point3::new(6.0, 5.0, -4.0), epsilon = 1.0e-6);
assert_relative_eq!(q * vec, Vector3::new(6.0, 5.0, -4.0), epsilon = 1.0e-6);
// A zero vector yields an identity.
assert_eq!(UnitQuaternion::new(Vector3::<f32>::zeros()), UnitQuaternion::identity());
sourcepub fn new_eps<SB>(axisangle: Vector<N, U3, SB>, eps: N) -> Selfwhere
SB: Storage<N, U3>,
pub fn new_eps<SB>(axisangle: Vector<N, U3, SB>, eps: N) -> Selfwhere
SB: Storage<N, U3>,
Creates a new unit quaternion rotation from a rotation axis scaled by the rotation angle.
If axisangle
has a magnitude smaller than eps
, this returns the identity rotation.
Example
let axisangle = Vector3::y() * f32::consts::FRAC_PI_2;
// Point and vector being transformed in the tests.
let pt = Point3::new(4.0, 5.0, 6.0);
let vec = Vector3::new(4.0, 5.0, 6.0);
let q = UnitQuaternion::new_eps(axisangle, 1.0e-6);
assert_relative_eq!(q * pt, Point3::new(6.0, 5.0, -4.0), epsilon = 1.0e-6);
assert_relative_eq!(q * vec, Vector3::new(6.0, 5.0, -4.0), epsilon = 1.0e-6);
// An almost zero vector yields an identity.
assert_eq!(UnitQuaternion::new_eps(Vector3::new(1.0e-8, 1.0e-9, 1.0e-7), 1.0e-6), UnitQuaternion::identity());
sourcepub fn from_scaled_axis<SB>(axisangle: Vector<N, U3, SB>) -> Selfwhere
SB: Storage<N, U3>,
pub fn from_scaled_axis<SB>(axisangle: Vector<N, U3, SB>) -> Selfwhere
SB: Storage<N, U3>,
Creates a new unit quaternion rotation from a rotation axis scaled by the rotation angle.
If axisangle
has a magnitude smaller than N::default_epsilon()
, this returns the identity rotation.
Same as Self::new(axisangle)
.
Example
let axisangle = Vector3::y() * f32::consts::FRAC_PI_2;
// Point and vector being transformed in the tests.
let pt = Point3::new(4.0, 5.0, 6.0);
let vec = Vector3::new(4.0, 5.0, 6.0);
let q = UnitQuaternion::from_scaled_axis(axisangle);
assert_relative_eq!(q * pt, Point3::new(6.0, 5.0, -4.0), epsilon = 1.0e-6);
assert_relative_eq!(q * vec, Vector3::new(6.0, 5.0, -4.0), epsilon = 1.0e-6);
// A zero vector yields an identity.
assert_eq!(UnitQuaternion::from_scaled_axis(Vector3::<f32>::zeros()), UnitQuaternion::identity());
sourcepub fn from_scaled_axis_eps<SB>(axisangle: Vector<N, U3, SB>, eps: N) -> Selfwhere
SB: Storage<N, U3>,
pub fn from_scaled_axis_eps<SB>(axisangle: Vector<N, U3, SB>, eps: N) -> Selfwhere
SB: Storage<N, U3>,
Creates a new unit quaternion rotation from a rotation axis scaled by the rotation angle.
If axisangle
has a magnitude smaller than eps
, this returns the identity rotation.
Same as Self::new_eps(axisangle, eps)
.
Example
let axisangle = Vector3::y() * f32::consts::FRAC_PI_2;
// Point and vector being transformed in the tests.
let pt = Point3::new(4.0, 5.0, 6.0);
let vec = Vector3::new(4.0, 5.0, 6.0);
let q = UnitQuaternion::from_scaled_axis_eps(axisangle, 1.0e-6);
assert_relative_eq!(q * pt, Point3::new(6.0, 5.0, -4.0), epsilon = 1.0e-6);
assert_relative_eq!(q * vec, Vector3::new(6.0, 5.0, -4.0), epsilon = 1.0e-6);
// An almost zero vector yields an identity.
assert_eq!(UnitQuaternion::from_scaled_axis_eps(Vector3::new(1.0e-8, 1.0e-9, 1.0e-7), 1.0e-6), UnitQuaternion::identity());
source§impl<N: Real> Unit<Complex<N>>
impl<N: Real> Unit<Complex<N>>
sourcepub fn angle(&self) -> N
pub fn angle(&self) -> N
The rotation angle in ]-pi; pi]
of this unit complex number.
Example
let rot = UnitComplex::new(1.78);
assert_eq!(rot.angle(), 1.78);
sourcepub fn sin_angle(&self) -> N
pub fn sin_angle(&self) -> N
The sine of the rotation angle.
Example
let angle = 1.78f32;
let rot = UnitComplex::new(angle);
assert_eq!(rot.sin_angle(), angle.sin());
sourcepub fn cos_angle(&self) -> N
pub fn cos_angle(&self) -> N
The cosine of the rotation angle.
Example
let angle = 1.78f32;
let rot = UnitComplex::new(angle);
assert_eq!(rot.cos_angle(),angle.cos());
sourcepub fn scaled_axis(&self) -> Vector1<N>
pub fn scaled_axis(&self) -> Vector1<N>
The rotation angle returned as a 1-dimensional vector.
This is generally used in the context of generic programming. Using
the .angle()
method instead is more common.
sourcepub fn axis_angle(&self) -> Option<(Unit<Vector1<N>>, N)>
pub fn axis_angle(&self) -> Option<(Unit<Vector1<N>>, N)>
The rotation axis and angle in ]0, pi] of this complex number.
This is generally used in the context of generic programming. Using
the .angle()
method instead is more common.
Returns None
if the angle is zero.
sourcepub fn complex(&self) -> &Complex<N>
pub fn complex(&self) -> &Complex<N>
The underlying complex number.
Same as self.as_ref()
.
Example
let angle = 1.78f32;
let rot = UnitComplex::new(angle);
assert_eq!(*rot.complex(), Complex::new(angle.cos(), angle.sin()));
sourcepub fn conjugate(&self) -> Self
pub fn conjugate(&self) -> Self
Compute the conjugate of this unit complex number.
Example
let rot = UnitComplex::new(1.78);
let conj = rot.conjugate();
assert_eq!(rot.complex().im, -conj.complex().im);
assert_eq!(rot.complex().re, conj.complex().re);
sourcepub fn inverse(&self) -> Self
pub fn inverse(&self) -> Self
Inverts this complex number if it is not zero.
Example
let rot = UnitComplex::new(1.2);
let inv = rot.inverse();
assert_relative_eq!(rot * inv, UnitComplex::identity(), epsilon = 1.0e-6);
assert_relative_eq!(inv * rot, UnitComplex::identity(), epsilon = 1.0e-6);
sourcepub fn angle_to(&self, other: &Self) -> N
pub fn angle_to(&self, other: &Self) -> N
The rotation angle needed to make self
and other
coincide.
Example
let rot1 = UnitComplex::new(0.1);
let rot2 = UnitComplex::new(1.7);
assert_relative_eq!(rot1.angle_to(&rot2), 1.6);
sourcepub fn rotation_to(&self, other: &Self) -> Self
pub fn rotation_to(&self, other: &Self) -> Self
The unit complex number needed to make self
and other
coincide.
The result is such that: self.rotation_to(other) * self == other
.
Example
let rot1 = UnitComplex::new(0.1);
let rot2 = UnitComplex::new(1.7);
let rot_to = rot1.rotation_to(&rot2);
assert_relative_eq!(rot_to * rot1, rot2);
assert_relative_eq!(rot_to.inverse() * rot2, rot1);
sourcepub fn conjugate_mut(&mut self)
pub fn conjugate_mut(&mut self)
Compute in-place the conjugate of this unit complex number.
Example
let angle = 1.7;
let rot = UnitComplex::new(angle);
let mut conj = UnitComplex::new(angle);
conj.conjugate_mut();
assert_eq!(rot.complex().im, -conj.complex().im);
assert_eq!(rot.complex().re, conj.complex().re);
sourcepub fn inverse_mut(&mut self)
pub fn inverse_mut(&mut self)
Inverts in-place this unit complex number.
Example
let angle = 1.7;
let mut rot = UnitComplex::new(angle);
rot.inverse_mut();
assert_relative_eq!(rot * UnitComplex::new(angle), UnitComplex::identity());
assert_relative_eq!(UnitComplex::new(angle) * rot, UnitComplex::identity());
sourcepub fn powf(&self, n: N) -> Self
pub fn powf(&self, n: N) -> Self
Raise this unit complex number to a given floating power.
This returns the unit complex number that identifies a rotation angle equal to
self.angle() × n
.
Example
let rot = UnitComplex::new(0.78);
let pow = rot.powf(2.0);
assert_eq!(pow.angle(), 2.0 * 0.78);
sourcepub fn to_rotation_matrix(&self) -> Rotation2<N>
pub fn to_rotation_matrix(&self) -> Rotation2<N>
Builds the rotation matrix corresponding to this unit complex number.
Example
let rot = UnitComplex::new(f32::consts::FRAC_PI_6);
let expected = Rotation2::new(f32::consts::FRAC_PI_6);
assert_eq!(rot.to_rotation_matrix(), expected);
sourcepub fn to_homogeneous(&self) -> Matrix3<N>
pub fn to_homogeneous(&self) -> Matrix3<N>
Converts this unit complex number into its equivalent homogeneous transformation matrix.
Example
let rot = UnitComplex::new(f32::consts::FRAC_PI_6);
let expected = Matrix3::new(0.8660254, -0.5, 0.0,
0.5, 0.8660254, 0.0,
0.0, 0.0, 1.0);
assert_eq!(rot.to_homogeneous(), expected);
source§impl<N: Real> Unit<Complex<N>>
impl<N: Real> Unit<Complex<N>>
sourcepub fn identity() -> Self
pub fn identity() -> Self
The unit complex number multiplicative identity.
Example
let rot1 = UnitComplex::identity();
let rot2 = UnitComplex::new(1.7);
assert_eq!(rot1 * rot2, rot2);
assert_eq!(rot2 * rot1, rot2);
sourcepub fn new(angle: N) -> Self
pub fn new(angle: N) -> Self
Builds the unit complex number corresponding to the rotation with the given angle.
Example
let rot = UnitComplex::new(f32::consts::FRAC_PI_2);
assert_relative_eq!(rot * Point2::new(3.0, 4.0), Point2::new(-4.0, 3.0));
sourcepub fn from_angle(angle: N) -> Self
pub fn from_angle(angle: N) -> Self
Builds the unit complex number corresponding to the rotation with the angle.
Same as Self::new(angle)
.
Example
let rot = UnitComplex::from_angle(f32::consts::FRAC_PI_2);
assert_relative_eq!(rot * Point2::new(3.0, 4.0), Point2::new(-4.0, 3.0));
sourcepub fn from_cos_sin_unchecked(cos: N, sin: N) -> Self
pub fn from_cos_sin_unchecked(cos: N, sin: N) -> Self
Builds the unit complex number from the sinus and cosinus of the rotation angle.
The input values are not checked to actually be cosines and sine of the same value.
Is is generally preferable to use the ::new(angle)
constructor instead.
Example
let angle = f32::consts::FRAC_PI_2;
let rot = UnitComplex::from_cos_sin_unchecked(angle.cos(), angle.sin());
assert_relative_eq!(rot * Point2::new(3.0, 4.0), Point2::new(-4.0, 3.0));
sourcepub fn from_scaled_axis<SB: Storage<N, U1>>(
axisangle: Vector<N, U1, SB>
) -> Self
pub fn from_scaled_axis<SB: Storage<N, U1>>(
axisangle: Vector<N, U1, SB>
) -> Self
Builds a unit complex rotation from an angle in radian wrapped in a 1-dimensional vector.
This is generally used in the context of generic programming. Using
the ::new(angle)
method instead is more common.
sourcepub fn from_complex(q: Complex<N>) -> Self
pub fn from_complex(q: Complex<N>) -> Self
Creates a new unit complex number from a complex number.
The input complex number will be normalized.
sourcepub fn from_complex_and_get(q: Complex<N>) -> (Self, N)
pub fn from_complex_and_get(q: Complex<N>) -> (Self, N)
Creates a new unit complex number from a complex number.
The input complex number will be normalized. Returns the norm of the complex number as well.
sourcepub fn from_rotation_matrix(rotmat: &Rotation2<N>) -> Self
pub fn from_rotation_matrix(rotmat: &Rotation2<N>) -> Self
Builds the unit complex number from the corresponding 2D rotation matrix.
Example
let rot = Rotation2::new(1.7);
let complex = UnitComplex::from_rotation_matrix(&rot);
assert_eq!(complex, UnitComplex::new(1.7));
sourcepub fn rotation_between<SB, SC>(
a: &Vector<N, U2, SB>,
b: &Vector<N, U2, SC>
) -> Selfwhere
SB: Storage<N, U2>,
SC: Storage<N, U2>,
pub fn rotation_between<SB, SC>(
a: &Vector<N, U2, SB>,
b: &Vector<N, U2, SC>
) -> Selfwhere
SB: Storage<N, U2>,
SC: Storage<N, U2>,
The unit complex needed to make a
and b
be collinear and point toward the same
direction.
Example
let a = Vector2::new(1.0, 2.0);
let b = Vector2::new(2.0, 1.0);
let rot = UnitComplex::rotation_between(&a, &b);
assert_relative_eq!(rot * a, b);
assert_relative_eq!(rot.inverse() * b, a);
sourcepub fn scaled_rotation_between<SB, SC>(
a: &Vector<N, U2, SB>,
b: &Vector<N, U2, SC>,
s: N
) -> Selfwhere
SB: Storage<N, U2>,
SC: Storage<N, U2>,
pub fn scaled_rotation_between<SB, SC>(
a: &Vector<N, U2, SB>,
b: &Vector<N, U2, SC>,
s: N
) -> Selfwhere
SB: Storage<N, U2>,
SC: Storage<N, U2>,
The smallest rotation needed to make a
and b
collinear and point toward the same
direction, raised to the power s
.
Example
let a = Vector2::new(1.0, 2.0);
let b = Vector2::new(2.0, 1.0);
let rot2 = UnitComplex::scaled_rotation_between(&a, &b, 0.2);
let rot5 = UnitComplex::scaled_rotation_between(&a, &b, 0.5);
assert_relative_eq!(rot2 * rot2 * rot2 * rot2 * rot2 * a, b, epsilon = 1.0e-6);
assert_relative_eq!(rot5 * rot5 * a, b, epsilon = 1.0e-6);
sourcepub fn rotation_between_axis<SB, SC>(
a: &Unit<Vector<N, U2, SB>>,
b: &Unit<Vector<N, U2, SC>>
) -> Selfwhere
SB: Storage<N, U2>,
SC: Storage<N, U2>,
pub fn rotation_between_axis<SB, SC>(
a: &Unit<Vector<N, U2, SB>>,
b: &Unit<Vector<N, U2, SC>>
) -> Selfwhere
SB: Storage<N, U2>,
SC: Storage<N, U2>,
The unit complex needed to make a
and b
be collinear and point toward the same
direction.
Example
let a = Unit::new_normalize(Vector2::new(1.0, 2.0));
let b = Unit::new_normalize(Vector2::new(2.0, 1.0));
let rot = UnitComplex::rotation_between_axis(&a, &b);
assert_relative_eq!(rot * a, b);
assert_relative_eq!(rot.inverse() * b, a);
sourcepub fn scaled_rotation_between_axis<SB, SC>(
na: &Unit<Vector<N, U2, SB>>,
nb: &Unit<Vector<N, U2, SC>>,
s: N
) -> Selfwhere
SB: Storage<N, U2>,
SC: Storage<N, U2>,
pub fn scaled_rotation_between_axis<SB, SC>(
na: &Unit<Vector<N, U2, SB>>,
nb: &Unit<Vector<N, U2, SC>>,
s: N
) -> Selfwhere
SB: Storage<N, U2>,
SC: Storage<N, U2>,
The smallest rotation needed to make a
and b
collinear and point toward the same
direction, raised to the power s
.
Example
let a = Unit::new_normalize(Vector2::new(1.0, 2.0));
let b = Unit::new_normalize(Vector2::new(2.0, 1.0));
let rot2 = UnitComplex::scaled_rotation_between_axis(&a, &b, 0.2);
let rot5 = UnitComplex::scaled_rotation_between_axis(&a, &b, 0.5);
assert_relative_eq!(rot2 * rot2 * rot2 * rot2 * rot2 * a, b, epsilon = 1.0e-6);
assert_relative_eq!(rot5 * rot5 * a, b, epsilon = 1.0e-6);
source§impl<N: Real> Unit<Complex<N>>
impl<N: Real> Unit<Complex<N>>
sourcepub fn rotate<R2: Dim, C2: Dim, S2: StorageMut<N, R2, C2>>(
&self,
rhs: &mut Matrix<N, R2, C2, S2>
)where
ShapeConstraint: DimEq<R2, U2>,
pub fn rotate<R2: Dim, C2: Dim, S2: StorageMut<N, R2, C2>>(
&self,
rhs: &mut Matrix<N, R2, C2, S2>
)where
ShapeConstraint: DimEq<R2, U2>,
Performs the multiplication rhs = self * rhs
in-place.
sourcepub fn rotate_rows<R2: Dim, C2: Dim, S2: StorageMut<N, R2, C2>>(
&self,
lhs: &mut Matrix<N, R2, C2, S2>
)where
ShapeConstraint: DimEq<C2, U2>,
pub fn rotate_rows<R2: Dim, C2: Dim, S2: StorageMut<N, R2, C2>>(
&self,
lhs: &mut Matrix<N, R2, C2, S2>
)where
ShapeConstraint: DimEq<C2, U2>,
Performs the multiplication lhs = lhs * self
in-place.
Trait Implementations§
source§impl<N: Real> AbsDiffEq<Unit<Complex<N>>> for UnitComplex<N>
impl<N: Real> AbsDiffEq<Unit<Complex<N>>> for UnitComplex<N>
source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
source§impl<N, R: Dim, C: Dim, S> AbsDiffEq<Unit<Matrix<N, R, C, S>>> for Unit<Matrix<N, R, C, S>>where
N: Scalar + AbsDiffEq,
S: Storage<N, R, C>,
N::Epsilon: Copy,
impl<N, R: Dim, C: Dim, S> AbsDiffEq<Unit<Matrix<N, R, C, S>>> for Unit<Matrix<N, R, C, S>>where
N: Scalar + AbsDiffEq,
S: Storage<N, R, C>,
N::Epsilon: Copy,
source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
source§impl<N: Real + AbsDiffEq<Epsilon = N>> AbsDiffEq<Unit<Quaternion<N>>> for UnitQuaternion<N>
impl<N: Real + AbsDiffEq<Epsilon = N>> AbsDiffEq<Unit<Quaternion<N>>> for UnitQuaternion<N>
source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
source§impl<N: Real> Distribution<Unit<Complex<N>>> for Standardwhere
OpenClosed01: Distribution<N>,
impl<N: Real> Distribution<Unit<Complex<N>>> for Standardwhere
OpenClosed01: Distribution<N>,
source§impl<N: Real, D: DimName> Distribution<Unit<Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D, U1>>::Buffer>>> for Standardwhere
DefaultAllocator: Allocator<N, D>,
StandardNormal: Distribution<N>,
impl<N: Real, D: DimName> Distribution<Unit<Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D, U1>>::Buffer>>> for Standardwhere
DefaultAllocator: Allocator<N, D>,
StandardNormal: Distribution<N>,
source§impl<N: Real> Distribution<Unit<Quaternion<N>>> for Standardwhere
OpenClosed01: Distribution<N>,
impl<N: Real> Distribution<Unit<Quaternion<N>>> for Standardwhere
OpenClosed01: Distribution<N>,
source§impl<'a, 'b, N: Real> Div<&'b Unit<Complex<N>>> for &'a Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
impl<'a, 'b, N: Real> Div<&'b Unit<Complex<N>>> for &'a Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
source§impl<'a, 'b, N: Real> Div<&'b Unit<Complex<N>>> for &'a UnitComplex<N>
impl<'a, 'b, N: Real> Div<&'b Unit<Complex<N>>> for &'a UnitComplex<N>
source§fn div(self, rhs: &'b UnitComplex<N>) -> UnitComplex<N>
fn div(self, rhs: &'b UnitComplex<N>) -> UnitComplex<N>
/
operation. Read moresource§impl<'b, N: Real> Div<&'b Unit<Complex<N>>> for Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
impl<'b, N: Real> Div<&'b Unit<Complex<N>>> for Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
source§impl<'b, N: Real> Div<&'b Unit<Complex<N>>> for UnitComplex<N>
impl<'b, N: Real> Div<&'b Unit<Complex<N>>> for UnitComplex<N>
source§fn div(self, rhs: &'b UnitComplex<N>) -> UnitComplex<N>
fn div(self, rhs: &'b UnitComplex<N>) -> UnitComplex<N>
/
operation. Read moresource§impl<'a, 'b, N: Real> Div<&'b Unit<Quaternion<N>>> for &'a Rotation<N, U3>where
DefaultAllocator: Allocator<N, U3, U3> + Allocator<N, U4, U1>,
impl<'a, 'b, N: Real> Div<&'b Unit<Quaternion<N>>> for &'a Rotation<N, U3>where
DefaultAllocator: Allocator<N, U3, U3> + Allocator<N, U4, U1>,
§type Output = Unit<Quaternion<N>>
type Output = Unit<Quaternion<N>>
/
operator.source§impl<'a, 'b, N, C: TCategoryMul<TAffine>> Div<&'b Unit<Quaternion<N>>> for &'a Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
impl<'a, 'b, N, C: TCategoryMul<TAffine>> Div<&'b Unit<Quaternion<N>>> for &'a Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
§type Output = Transform<N, U3, <C as TCategoryMul<TAffine>>::Representative>
type Output = Transform<N, U3, <C as TCategoryMul<TAffine>>::Representative>
/
operator.source§impl<'a, 'b, N: Real> Div<&'b Unit<Quaternion<N>>> for &'a UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
impl<'a, 'b, N: Real> Div<&'b Unit<Quaternion<N>>> for &'a UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
§type Output = Unit<Quaternion<N>>
type Output = Unit<Quaternion<N>>
/
operator.source§impl<'b, N: Real> Div<&'b Unit<Quaternion<N>>> for Rotation<N, U3>where
DefaultAllocator: Allocator<N, U3, U3> + Allocator<N, U4, U1>,
impl<'b, N: Real> Div<&'b Unit<Quaternion<N>>> for Rotation<N, U3>where
DefaultAllocator: Allocator<N, U3, U3> + Allocator<N, U4, U1>,
§type Output = Unit<Quaternion<N>>
type Output = Unit<Quaternion<N>>
/
operator.source§impl<'b, N, C: TCategoryMul<TAffine>> Div<&'b Unit<Quaternion<N>>> for Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
impl<'b, N, C: TCategoryMul<TAffine>> Div<&'b Unit<Quaternion<N>>> for Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
§type Output = Transform<N, U3, <C as TCategoryMul<TAffine>>::Representative>
type Output = Transform<N, U3, <C as TCategoryMul<TAffine>>::Representative>
/
operator.source§impl<'b, N: Real> Div<&'b Unit<Quaternion<N>>> for UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
impl<'b, N: Real> Div<&'b Unit<Quaternion<N>>> for UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
§type Output = Unit<Quaternion<N>>
type Output = Unit<Quaternion<N>>
/
operator.source§impl<'a, N: Real> Div<Unit<Complex<N>>> for &'a Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
impl<'a, N: Real> Div<Unit<Complex<N>>> for &'a Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
source§impl<'a, N: Real> Div<Unit<Complex<N>>> for &'a UnitComplex<N>
impl<'a, N: Real> Div<Unit<Complex<N>>> for &'a UnitComplex<N>
source§fn div(self, rhs: UnitComplex<N>) -> UnitComplex<N>
fn div(self, rhs: UnitComplex<N>) -> UnitComplex<N>
/
operation. Read moresource§impl<N: Real> Div<Unit<Complex<N>>> for Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
impl<N: Real> Div<Unit<Complex<N>>> for Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
source§impl<N: Real> Div<Unit<Complex<N>>> for UnitComplex<N>
impl<N: Real> Div<Unit<Complex<N>>> for UnitComplex<N>
source§fn div(self, rhs: UnitComplex<N>) -> UnitComplex<N>
fn div(self, rhs: UnitComplex<N>) -> UnitComplex<N>
/
operation. Read moresource§impl<'a, N: Real> Div<Unit<Quaternion<N>>> for &'a Rotation<N, U3>where
DefaultAllocator: Allocator<N, U3, U3> + Allocator<N, U4, U1>,
impl<'a, N: Real> Div<Unit<Quaternion<N>>> for &'a Rotation<N, U3>where
DefaultAllocator: Allocator<N, U3, U3> + Allocator<N, U4, U1>,
§type Output = Unit<Quaternion<N>>
type Output = Unit<Quaternion<N>>
/
operator.source§impl<'a, N, C: TCategoryMul<TAffine>> Div<Unit<Quaternion<N>>> for &'a Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
impl<'a, N, C: TCategoryMul<TAffine>> Div<Unit<Quaternion<N>>> for &'a Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
§type Output = Transform<N, U3, <C as TCategoryMul<TAffine>>::Representative>
type Output = Transform<N, U3, <C as TCategoryMul<TAffine>>::Representative>
/
operator.source§impl<'a, N: Real> Div<Unit<Quaternion<N>>> for &'a UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
impl<'a, N: Real> Div<Unit<Quaternion<N>>> for &'a UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
§type Output = Unit<Quaternion<N>>
type Output = Unit<Quaternion<N>>
/
operator.source§impl<N: Real> Div<Unit<Quaternion<N>>> for Rotation<N, U3>where
DefaultAllocator: Allocator<N, U3, U3> + Allocator<N, U4, U1>,
impl<N: Real> Div<Unit<Quaternion<N>>> for Rotation<N, U3>where
DefaultAllocator: Allocator<N, U3, U3> + Allocator<N, U4, U1>,
§type Output = Unit<Quaternion<N>>
type Output = Unit<Quaternion<N>>
/
operator.source§impl<N, C: TCategoryMul<TAffine>> Div<Unit<Quaternion<N>>> for Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
impl<N, C: TCategoryMul<TAffine>> Div<Unit<Quaternion<N>>> for Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
§type Output = Transform<N, U3, <C as TCategoryMul<TAffine>>::Representative>
type Output = Transform<N, U3, <C as TCategoryMul<TAffine>>::Representative>
/
operator.source§impl<N: Real> Div<Unit<Quaternion<N>>> for UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
impl<N: Real> Div<Unit<Quaternion<N>>> for UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
§type Output = Unit<Quaternion<N>>
type Output = Unit<Quaternion<N>>
/
operator.source§impl<'b, N: Real> DivAssign<&'b Unit<Complex<N>>> for Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
impl<'b, N: Real> DivAssign<&'b Unit<Complex<N>>> for Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
source§fn div_assign(&mut self, rhs: &'b UnitComplex<N>)
fn div_assign(&mut self, rhs: &'b UnitComplex<N>)
/=
operation. Read moresource§impl<'b, N: Real> DivAssign<&'b Unit<Complex<N>>> for UnitComplex<N>
impl<'b, N: Real> DivAssign<&'b Unit<Complex<N>>> for UnitComplex<N>
source§fn div_assign(&mut self, rhs: &'b UnitComplex<N>)
fn div_assign(&mut self, rhs: &'b UnitComplex<N>)
/=
operation. Read moresource§impl<'b, N, C: TCategory> DivAssign<&'b Unit<Quaternion<N>>> for Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
impl<'b, N, C: TCategory> DivAssign<&'b Unit<Quaternion<N>>> for Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
source§fn div_assign(&mut self, rhs: &'b UnitQuaternion<N>)
fn div_assign(&mut self, rhs: &'b UnitQuaternion<N>)
/=
operation. Read moresource§impl<'b, N: Real> DivAssign<&'b Unit<Quaternion<N>>> for UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
impl<'b, N: Real> DivAssign<&'b Unit<Quaternion<N>>> for UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
source§fn div_assign(&mut self, rhs: &'b UnitQuaternion<N>)
fn div_assign(&mut self, rhs: &'b UnitQuaternion<N>)
/=
operation. Read moresource§impl<N: Real> DivAssign<Unit<Complex<N>>> for Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
impl<N: Real> DivAssign<Unit<Complex<N>>> for Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
source§fn div_assign(&mut self, rhs: UnitComplex<N>)
fn div_assign(&mut self, rhs: UnitComplex<N>)
/=
operation. Read moresource§impl<N: Real> DivAssign<Unit<Complex<N>>> for UnitComplex<N>
impl<N: Real> DivAssign<Unit<Complex<N>>> for UnitComplex<N>
source§fn div_assign(&mut self, rhs: UnitComplex<N>)
fn div_assign(&mut self, rhs: UnitComplex<N>)
/=
operation. Read moresource§impl<N, C: TCategory> DivAssign<Unit<Quaternion<N>>> for Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
impl<N, C: TCategory> DivAssign<Unit<Quaternion<N>>> for Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
source§fn div_assign(&mut self, rhs: UnitQuaternion<N>)
fn div_assign(&mut self, rhs: UnitQuaternion<N>)
/=
operation. Read moresource§impl<N: Real> DivAssign<Unit<Quaternion<N>>> for UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
impl<N: Real> DivAssign<Unit<Quaternion<N>>> for UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
source§fn div_assign(&mut self, rhs: UnitQuaternion<N>)
fn div_assign(&mut self, rhs: UnitQuaternion<N>)
/=
operation. Read moresource§impl<N: Real> From<Unit<Complex<N>>> for Matrix2<N>
impl<N: Real> From<Unit<Complex<N>>> for Matrix2<N>
source§fn from(q: UnitComplex<N>) -> Matrix2<N>
fn from(q: UnitComplex<N>) -> Matrix2<N>
source§impl<N: Real> From<Unit<Complex<N>>> for Matrix3<N>
impl<N: Real> From<Unit<Complex<N>>> for Matrix3<N>
source§fn from(q: UnitComplex<N>) -> Matrix3<N>
fn from(q: UnitComplex<N>) -> Matrix3<N>
source§impl<N: Real> From<Unit<Quaternion<N>>> for Matrix3<N>
impl<N: Real> From<Unit<Quaternion<N>>> for Matrix3<N>
source§fn from(q: UnitQuaternion<N>) -> Matrix3<N>
fn from(q: UnitQuaternion<N>) -> Matrix3<N>
source§impl<N: Real> From<Unit<Quaternion<N>>> for Matrix4<N>
impl<N: Real> From<Unit<Quaternion<N>>> for Matrix4<N>
source§fn from(q: UnitQuaternion<N>) -> Matrix4<N>
fn from(q: UnitQuaternion<N>) -> Matrix4<N>
source§impl<'a, 'b, N: Real> Mul<&'b Unit<Complex<N>>> for &'a Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
impl<'a, 'b, N: Real> Mul<&'b Unit<Complex<N>>> for &'a Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
source§impl<'a, 'b, N: Real> Mul<&'b Unit<Complex<N>>> for &'a Translation<N, U2>where
DefaultAllocator: Allocator<N, U2, U1>,
impl<'a, 'b, N: Real> Mul<&'b Unit<Complex<N>>> for &'a Translation<N, U2>where
DefaultAllocator: Allocator<N, U2, U1>,
source§impl<'a, 'b, N: Real> Mul<&'b Unit<Complex<N>>> for &'a UnitComplex<N>
impl<'a, 'b, N: Real> Mul<&'b Unit<Complex<N>>> for &'a UnitComplex<N>
source§fn mul(self, rhs: &'b UnitComplex<N>) -> UnitComplex<N>
fn mul(self, rhs: &'b UnitComplex<N>) -> UnitComplex<N>
*
operation. Read moresource§impl<'b, N: Real> Mul<&'b Unit<Complex<N>>> for Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
impl<'b, N: Real> Mul<&'b Unit<Complex<N>>> for Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
source§impl<'b, N: Real> Mul<&'b Unit<Complex<N>>> for Translation<N, U2>where
DefaultAllocator: Allocator<N, U2, U1>,
impl<'b, N: Real> Mul<&'b Unit<Complex<N>>> for Translation<N, U2>where
DefaultAllocator: Allocator<N, U2, U1>,
source§impl<'b, N: Real> Mul<&'b Unit<Complex<N>>> for UnitComplex<N>
impl<'b, N: Real> Mul<&'b Unit<Complex<N>>> for UnitComplex<N>
source§fn mul(self, rhs: &'b UnitComplex<N>) -> UnitComplex<N>
fn mul(self, rhs: &'b UnitComplex<N>) -> UnitComplex<N>
*
operation. Read moresource§impl<'a, 'b, N: Real, D: DimName, R> Mul<&'b Unit<Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D, U1>>::Buffer>>> for &'a Isometry<N, D, R>where
R: AlgaRotation<Point<N, D>>,
DefaultAllocator: Allocator<N, D>,
impl<'a, 'b, N: Real, D: DimName, R> Mul<&'b Unit<Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D, U1>>::Buffer>>> for &'a Isometry<N, D, R>where
R: AlgaRotation<Point<N, D>>,
DefaultAllocator: Allocator<N, D>,
source§impl<'b, N: Real, D: DimName, R> Mul<&'b Unit<Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D, U1>>::Buffer>>> for Isometry<N, D, R>where
R: AlgaRotation<Point<N, D>>,
DefaultAllocator: Allocator<N, D>,
impl<'b, N: Real, D: DimName, R> Mul<&'b Unit<Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D, U1>>::Buffer>>> for Isometry<N, D, R>where
R: AlgaRotation<Point<N, D>>,
DefaultAllocator: Allocator<N, D>,
source§impl<'a, 'b, N, D: DimName, S: Storage<N, D>> Mul<&'b Unit<Matrix<N, D, U1, S>>> for &'a Rotation<N, D>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul,
DefaultAllocator: Allocator<N, D, D> + Allocator<N, D, U1>,
DefaultAllocator: Allocator<N, D>,
ShapeConstraint: AreMultipliable<D, D, D, U1>,
impl<'a, 'b, N, D: DimName, S: Storage<N, D>> Mul<&'b Unit<Matrix<N, D, U1, S>>> for &'a Rotation<N, D>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul,
DefaultAllocator: Allocator<N, D, D> + Allocator<N, D, U1>,
DefaultAllocator: Allocator<N, D>,
ShapeConstraint: AreMultipliable<D, D, D, U1>,
source§impl<'b, N, D: DimName, S: Storage<N, D>> Mul<&'b Unit<Matrix<N, D, U1, S>>> for Rotation<N, D>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul,
DefaultAllocator: Allocator<N, D, D> + Allocator<N, D, U1>,
DefaultAllocator: Allocator<N, D>,
ShapeConstraint: AreMultipliable<D, D, D, U1>,
impl<'b, N, D: DimName, S: Storage<N, D>> Mul<&'b Unit<Matrix<N, D, U1, S>>> for Rotation<N, D>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul,
DefaultAllocator: Allocator<N, D, D> + Allocator<N, D, U1>,
DefaultAllocator: Allocator<N, D>,
ShapeConstraint: AreMultipliable<D, D, D, U1>,
source§impl<'a, 'b, N: Real, S: Storage<N, U2>> Mul<&'b Unit<Matrix<N, U2, U1, S>>> for &'a UnitComplex<N>where
DefaultAllocator: Allocator<N, U2, U1>,
impl<'a, 'b, N: Real, S: Storage<N, U2>> Mul<&'b Unit<Matrix<N, U2, U1, S>>> for &'a UnitComplex<N>where
DefaultAllocator: Allocator<N, U2, U1>,
source§impl<'b, N: Real, S: Storage<N, U2>> Mul<&'b Unit<Matrix<N, U2, U1, S>>> for UnitComplex<N>where
DefaultAllocator: Allocator<N, U2, U1>,
impl<'b, N: Real, S: Storage<N, U2>> Mul<&'b Unit<Matrix<N, U2, U1, S>>> for UnitComplex<N>where
DefaultAllocator: Allocator<N, U2, U1>,
source§impl<'a, 'b, N: Real, SB: Storage<N, U3>> Mul<&'b Unit<Matrix<N, U3, U1, SB>>> for &'a UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U3, U1>,
impl<'a, 'b, N: Real, SB: Storage<N, U3>> Mul<&'b Unit<Matrix<N, U3, U1, SB>>> for &'a UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U3, U1>,
source§impl<'b, N: Real, SB: Storage<N, U3>> Mul<&'b Unit<Matrix<N, U3, U1, SB>>> for UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U3, U1>,
impl<'b, N: Real, SB: Storage<N, U3>> Mul<&'b Unit<Matrix<N, U3, U1, SB>>> for UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U3, U1>,
source§impl<'a, 'b, N: Real> Mul<&'b Unit<Quaternion<N>>> for &'a Rotation<N, U3>where
DefaultAllocator: Allocator<N, U3, U3> + Allocator<N, U4, U1>,
impl<'a, 'b, N: Real> Mul<&'b Unit<Quaternion<N>>> for &'a Rotation<N, U3>where
DefaultAllocator: Allocator<N, U3, U3> + Allocator<N, U4, U1>,
§type Output = Unit<Quaternion<N>>
type Output = Unit<Quaternion<N>>
*
operator.source§impl<'a, 'b, N, C: TCategoryMul<TAffine>> Mul<&'b Unit<Quaternion<N>>> for &'a Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
impl<'a, 'b, N, C: TCategoryMul<TAffine>> Mul<&'b Unit<Quaternion<N>>> for &'a Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
§type Output = Transform<N, U3, <C as TCategoryMul<TAffine>>::Representative>
type Output = Transform<N, U3, <C as TCategoryMul<TAffine>>::Representative>
*
operator.source§impl<'a, 'b, N: Real> Mul<&'b Unit<Quaternion<N>>> for &'a Translation<N, U3>where
DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U3, U1>,
impl<'a, 'b, N: Real> Mul<&'b Unit<Quaternion<N>>> for &'a Translation<N, U3>where
DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U3, U1>,
source§impl<'a, 'b, N: Real> Mul<&'b Unit<Quaternion<N>>> for &'a UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
impl<'a, 'b, N: Real> Mul<&'b Unit<Quaternion<N>>> for &'a UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
§type Output = Unit<Quaternion<N>>
type Output = Unit<Quaternion<N>>
*
operator.source§impl<'b, N: Real> Mul<&'b Unit<Quaternion<N>>> for Rotation<N, U3>where
DefaultAllocator: Allocator<N, U3, U3> + Allocator<N, U4, U1>,
impl<'b, N: Real> Mul<&'b Unit<Quaternion<N>>> for Rotation<N, U3>where
DefaultAllocator: Allocator<N, U3, U3> + Allocator<N, U4, U1>,
§type Output = Unit<Quaternion<N>>
type Output = Unit<Quaternion<N>>
*
operator.source§impl<'b, N, C: TCategoryMul<TAffine>> Mul<&'b Unit<Quaternion<N>>> for Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
impl<'b, N, C: TCategoryMul<TAffine>> Mul<&'b Unit<Quaternion<N>>> for Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
§type Output = Transform<N, U3, <C as TCategoryMul<TAffine>>::Representative>
type Output = Transform<N, U3, <C as TCategoryMul<TAffine>>::Representative>
*
operator.source§impl<'b, N: Real> Mul<&'b Unit<Quaternion<N>>> for Translation<N, U3>where
DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U3, U1>,
impl<'b, N: Real> Mul<&'b Unit<Quaternion<N>>> for Translation<N, U3>where
DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U3, U1>,
source§impl<'b, N: Real> Mul<&'b Unit<Quaternion<N>>> for UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
impl<'b, N: Real> Mul<&'b Unit<Quaternion<N>>> for UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
§type Output = Unit<Quaternion<N>>
type Output = Unit<Quaternion<N>>
*
operator.source§impl<'a, N: Real> Mul<Unit<Complex<N>>> for &'a Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
impl<'a, N: Real> Mul<Unit<Complex<N>>> for &'a Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
source§impl<'a, N: Real> Mul<Unit<Complex<N>>> for &'a Translation<N, U2>where
DefaultAllocator: Allocator<N, U2, U1>,
impl<'a, N: Real> Mul<Unit<Complex<N>>> for &'a Translation<N, U2>where
DefaultAllocator: Allocator<N, U2, U1>,
source§impl<'a, N: Real> Mul<Unit<Complex<N>>> for &'a UnitComplex<N>
impl<'a, N: Real> Mul<Unit<Complex<N>>> for &'a UnitComplex<N>
source§fn mul(self, rhs: UnitComplex<N>) -> UnitComplex<N>
fn mul(self, rhs: UnitComplex<N>) -> UnitComplex<N>
*
operation. Read moresource§impl<N: Real> Mul<Unit<Complex<N>>> for Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
impl<N: Real> Mul<Unit<Complex<N>>> for Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
source§impl<N: Real> Mul<Unit<Complex<N>>> for Translation<N, U2>where
DefaultAllocator: Allocator<N, U2, U1>,
impl<N: Real> Mul<Unit<Complex<N>>> for Translation<N, U2>where
DefaultAllocator: Allocator<N, U2, U1>,
source§impl<N: Real> Mul<Unit<Complex<N>>> for UnitComplex<N>
impl<N: Real> Mul<Unit<Complex<N>>> for UnitComplex<N>
source§fn mul(self, rhs: UnitComplex<N>) -> UnitComplex<N>
fn mul(self, rhs: UnitComplex<N>) -> UnitComplex<N>
*
operation. Read moresource§impl<'a, N: Real, D: DimName, R> Mul<Unit<Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D, U1>>::Buffer>>> for &'a Isometry<N, D, R>where
R: AlgaRotation<Point<N, D>>,
DefaultAllocator: Allocator<N, D>,
impl<'a, N: Real, D: DimName, R> Mul<Unit<Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D, U1>>::Buffer>>> for &'a Isometry<N, D, R>where
R: AlgaRotation<Point<N, D>>,
DefaultAllocator: Allocator<N, D>,
source§impl<N: Real, D: DimName, R> Mul<Unit<Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D, U1>>::Buffer>>> for Isometry<N, D, R>where
R: AlgaRotation<Point<N, D>>,
DefaultAllocator: Allocator<N, D>,
impl<N: Real, D: DimName, R> Mul<Unit<Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D, U1>>::Buffer>>> for Isometry<N, D, R>where
R: AlgaRotation<Point<N, D>>,
DefaultAllocator: Allocator<N, D>,
source§impl<'a, N, D: DimName, S: Storage<N, D>> Mul<Unit<Matrix<N, D, U1, S>>> for &'a Rotation<N, D>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul,
DefaultAllocator: Allocator<N, D, D> + Allocator<N, D, U1>,
DefaultAllocator: Allocator<N, D>,
ShapeConstraint: AreMultipliable<D, D, D, U1>,
impl<'a, N, D: DimName, S: Storage<N, D>> Mul<Unit<Matrix<N, D, U1, S>>> for &'a Rotation<N, D>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul,
DefaultAllocator: Allocator<N, D, D> + Allocator<N, D, U1>,
DefaultAllocator: Allocator<N, D>,
ShapeConstraint: AreMultipliable<D, D, D, U1>,
source§impl<N, D: DimName, S: Storage<N, D>> Mul<Unit<Matrix<N, D, U1, S>>> for Rotation<N, D>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul,
DefaultAllocator: Allocator<N, D, D> + Allocator<N, D, U1>,
DefaultAllocator: Allocator<N, D>,
ShapeConstraint: AreMultipliable<D, D, D, U1>,
impl<N, D: DimName, S: Storage<N, D>> Mul<Unit<Matrix<N, D, U1, S>>> for Rotation<N, D>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul,
DefaultAllocator: Allocator<N, D, D> + Allocator<N, D, U1>,
DefaultAllocator: Allocator<N, D>,
ShapeConstraint: AreMultipliable<D, D, D, U1>,
source§impl<'a, N: Real, S: Storage<N, U2>> Mul<Unit<Matrix<N, U2, U1, S>>> for &'a UnitComplex<N>where
DefaultAllocator: Allocator<N, U2, U1>,
impl<'a, N: Real, S: Storage<N, U2>> Mul<Unit<Matrix<N, U2, U1, S>>> for &'a UnitComplex<N>where
DefaultAllocator: Allocator<N, U2, U1>,
source§impl<N: Real, S: Storage<N, U2>> Mul<Unit<Matrix<N, U2, U1, S>>> for UnitComplex<N>where
DefaultAllocator: Allocator<N, U2, U1>,
impl<N: Real, S: Storage<N, U2>> Mul<Unit<Matrix<N, U2, U1, S>>> for UnitComplex<N>where
DefaultAllocator: Allocator<N, U2, U1>,
source§impl<'a, N: Real, SB: Storage<N, U3>> Mul<Unit<Matrix<N, U3, U1, SB>>> for &'a UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U3, U1>,
impl<'a, N: Real, SB: Storage<N, U3>> Mul<Unit<Matrix<N, U3, U1, SB>>> for &'a UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U3, U1>,
source§impl<N: Real, SB: Storage<N, U3>> Mul<Unit<Matrix<N, U3, U1, SB>>> for UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U3, U1>,
impl<N: Real, SB: Storage<N, U3>> Mul<Unit<Matrix<N, U3, U1, SB>>> for UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U3, U1>,
source§impl<'a, N: Real> Mul<Unit<Quaternion<N>>> for &'a Rotation<N, U3>where
DefaultAllocator: Allocator<N, U3, U3> + Allocator<N, U4, U1>,
impl<'a, N: Real> Mul<Unit<Quaternion<N>>> for &'a Rotation<N, U3>where
DefaultAllocator: Allocator<N, U3, U3> + Allocator<N, U4, U1>,
§type Output = Unit<Quaternion<N>>
type Output = Unit<Quaternion<N>>
*
operator.source§impl<'a, N, C: TCategoryMul<TAffine>> Mul<Unit<Quaternion<N>>> for &'a Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
impl<'a, N, C: TCategoryMul<TAffine>> Mul<Unit<Quaternion<N>>> for &'a Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
§type Output = Transform<N, U3, <C as TCategoryMul<TAffine>>::Representative>
type Output = Transform<N, U3, <C as TCategoryMul<TAffine>>::Representative>
*
operator.source§impl<'a, N: Real> Mul<Unit<Quaternion<N>>> for &'a Translation<N, U3>where
DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U3, U1>,
impl<'a, N: Real> Mul<Unit<Quaternion<N>>> for &'a Translation<N, U3>where
DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U3, U1>,
source§impl<'a, N: Real> Mul<Unit<Quaternion<N>>> for &'a UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
impl<'a, N: Real> Mul<Unit<Quaternion<N>>> for &'a UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
§type Output = Unit<Quaternion<N>>
type Output = Unit<Quaternion<N>>
*
operator.source§impl<N: Real> Mul<Unit<Quaternion<N>>> for Rotation<N, U3>where
DefaultAllocator: Allocator<N, U3, U3> + Allocator<N, U4, U1>,
impl<N: Real> Mul<Unit<Quaternion<N>>> for Rotation<N, U3>where
DefaultAllocator: Allocator<N, U3, U3> + Allocator<N, U4, U1>,
§type Output = Unit<Quaternion<N>>
type Output = Unit<Quaternion<N>>
*
operator.source§impl<N, C: TCategoryMul<TAffine>> Mul<Unit<Quaternion<N>>> for Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
impl<N, C: TCategoryMul<TAffine>> Mul<Unit<Quaternion<N>>> for Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
§type Output = Transform<N, U3, <C as TCategoryMul<TAffine>>::Representative>
type Output = Transform<N, U3, <C as TCategoryMul<TAffine>>::Representative>
*
operator.source§impl<N: Real> Mul<Unit<Quaternion<N>>> for Translation<N, U3>where
DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U3, U1>,
impl<N: Real> Mul<Unit<Quaternion<N>>> for Translation<N, U3>where
DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U3, U1>,
source§impl<N: Real> Mul<Unit<Quaternion<N>>> for UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
impl<N: Real> Mul<Unit<Quaternion<N>>> for UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
§type Output = Unit<Quaternion<N>>
type Output = Unit<Quaternion<N>>
*
operator.source§impl<'b, N: Real> MulAssign<&'b Unit<Complex<N>>> for Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
impl<'b, N: Real> MulAssign<&'b Unit<Complex<N>>> for Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
source§fn mul_assign(&mut self, rhs: &'b UnitComplex<N>)
fn mul_assign(&mut self, rhs: &'b UnitComplex<N>)
*=
operation. Read moresource§impl<'b, N: Real> MulAssign<&'b Unit<Complex<N>>> for UnitComplex<N>
impl<'b, N: Real> MulAssign<&'b Unit<Complex<N>>> for UnitComplex<N>
source§fn mul_assign(&mut self, rhs: &'b UnitComplex<N>)
fn mul_assign(&mut self, rhs: &'b UnitComplex<N>)
*=
operation. Read moresource§impl<'b, N, C: TCategory> MulAssign<&'b Unit<Quaternion<N>>> for Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
impl<'b, N, C: TCategory> MulAssign<&'b Unit<Quaternion<N>>> for Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
source§fn mul_assign(&mut self, rhs: &'b UnitQuaternion<N>)
fn mul_assign(&mut self, rhs: &'b UnitQuaternion<N>)
*=
operation. Read moresource§impl<'b, N: Real> MulAssign<&'b Unit<Quaternion<N>>> for UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
impl<'b, N: Real> MulAssign<&'b Unit<Quaternion<N>>> for UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
source§fn mul_assign(&mut self, rhs: &'b UnitQuaternion<N>)
fn mul_assign(&mut self, rhs: &'b UnitQuaternion<N>)
*=
operation. Read moresource§impl<N: Real> MulAssign<Unit<Complex<N>>> for Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
impl<N: Real> MulAssign<Unit<Complex<N>>> for Rotation<N, U2>where
DefaultAllocator: Allocator<N, U2, U2>,
source§fn mul_assign(&mut self, rhs: UnitComplex<N>)
fn mul_assign(&mut self, rhs: UnitComplex<N>)
*=
operation. Read moresource§impl<N: Real> MulAssign<Unit<Complex<N>>> for UnitComplex<N>
impl<N: Real> MulAssign<Unit<Complex<N>>> for UnitComplex<N>
source§fn mul_assign(&mut self, rhs: UnitComplex<N>)
fn mul_assign(&mut self, rhs: UnitComplex<N>)
*=
operation. Read moresource§impl<N, C: TCategory> MulAssign<Unit<Quaternion<N>>> for Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
impl<N, C: TCategory> MulAssign<Unit<Quaternion<N>>> for Transform<N, U3, C>where
N: Scalar + Zero + One + ClosedAdd + ClosedMul + Real,
DefaultAllocator: Allocator<N, U4, U4> + Allocator<N, U4, U1>,
source§fn mul_assign(&mut self, rhs: UnitQuaternion<N>)
fn mul_assign(&mut self, rhs: UnitQuaternion<N>)
*=
operation. Read moresource§impl<N: Real> MulAssign<Unit<Quaternion<N>>> for UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
impl<N: Real> MulAssign<Unit<Quaternion<N>>> for UnitQuaternion<N>where
DefaultAllocator: Allocator<N, U4, U1>,
source§fn mul_assign(&mut self, rhs: UnitQuaternion<N>)
fn mul_assign(&mut self, rhs: UnitQuaternion<N>)
*=
operation. Read moresource§impl<T: PartialEq> PartialEq<Unit<T>> for Unit<T>
impl<T: PartialEq> PartialEq<Unit<T>> for Unit<T>
source§impl<N: Real> RelativeEq<Unit<Complex<N>>> for UnitComplex<N>
impl<N: Real> RelativeEq<Unit<Complex<N>>> for UnitComplex<N>
source§fn default_max_relative() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
source§impl<N, R: Dim, C: Dim, S> RelativeEq<Unit<Matrix<N, R, C, S>>> for Unit<Matrix<N, R, C, S>>where
N: Scalar + RelativeEq,
S: Storage<N, R, C>,
N::Epsilon: Copy,
impl<N, R: Dim, C: Dim, S> RelativeEq<Unit<Matrix<N, R, C, S>>> for Unit<Matrix<N, R, C, S>>where
N: Scalar + RelativeEq,
S: Storage<N, R, C>,
N::Epsilon: Copy,
source§fn default_max_relative() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
source§impl<N: Real + RelativeEq<Epsilon = N>> RelativeEq<Unit<Quaternion<N>>> for UnitQuaternion<N>
impl<N: Real + RelativeEq<Epsilon = N>> RelativeEq<Unit<Quaternion<N>>> for UnitQuaternion<N>
source§fn default_max_relative() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
source§impl<T: NormedSpace> SubsetOf<T> for Unit<T>where
T::Field: RelativeEq,
impl<T: NormedSpace> SubsetOf<T> for Unit<T>where
T::Field: RelativeEq,
source§fn to_superset(&self) -> T
fn to_superset(&self) -> T
self
to the equivalent element of its superset.source§fn is_in_subset(value: &T) -> bool
fn is_in_subset(value: &T) -> bool
element
is actually part of the subset Self
(and can be converted to it).source§unsafe fn from_superset_unchecked(value: &T) -> Self
unsafe fn from_superset_unchecked(value: &T) -> Self
self.to_superset
but without any property checks. Always succeeds.source§impl<N1, N2> SubsetOf<Unit<Complex<N2>>> for Rotation2<N1>where
N1: Real,
N2: Real + SupersetOf<N1>,
impl<N1, N2> SubsetOf<Unit<Complex<N2>>> for Rotation2<N1>where
N1: Real,
N2: Real + SupersetOf<N1>,
source§fn to_superset(&self) -> UnitComplex<N2>
fn to_superset(&self) -> UnitComplex<N2>
self
to the equivalent element of its superset.source§fn is_in_subset(q: &UnitComplex<N2>) -> bool
fn is_in_subset(q: &UnitComplex<N2>) -> bool
element
is actually part of the subset Self
(and can be converted to it).source§unsafe fn from_superset_unchecked(q: &UnitComplex<N2>) -> Self
unsafe fn from_superset_unchecked(q: &UnitComplex<N2>) -> Self
self.to_superset
but without any property checks. Always succeeds.source§impl<N1, N2> SubsetOf<Unit<Complex<N2>>> for UnitComplex<N1>where
N1: Real,
N2: Real + SupersetOf<N1>,
impl<N1, N2> SubsetOf<Unit<Complex<N2>>> for UnitComplex<N1>where
N1: Real,
N2: Real + SupersetOf<N1>,
source§fn to_superset(&self) -> UnitComplex<N2>
fn to_superset(&self) -> UnitComplex<N2>
self
to the equivalent element of its superset.source§fn is_in_subset(uq: &UnitComplex<N2>) -> bool
fn is_in_subset(uq: &UnitComplex<N2>) -> bool
element
is actually part of the subset Self
(and can be converted to it).source§unsafe fn from_superset_unchecked(uq: &UnitComplex<N2>) -> Self
unsafe fn from_superset_unchecked(uq: &UnitComplex<N2>) -> Self
self.to_superset
but without any property checks. Always succeeds.source§impl<N1, N2> SubsetOf<Unit<Quaternion<N2>>> for Rotation3<N1>where
N1: Real,
N2: Real + SupersetOf<N1>,
impl<N1, N2> SubsetOf<Unit<Quaternion<N2>>> for Rotation3<N1>where
N1: Real,
N2: Real + SupersetOf<N1>,
source§fn to_superset(&self) -> UnitQuaternion<N2>
fn to_superset(&self) -> UnitQuaternion<N2>
self
to the equivalent element of its superset.source§fn is_in_subset(q: &UnitQuaternion<N2>) -> bool
fn is_in_subset(q: &UnitQuaternion<N2>) -> bool
element
is actually part of the subset Self
(and can be converted to it).source§unsafe fn from_superset_unchecked(q: &UnitQuaternion<N2>) -> Self
unsafe fn from_superset_unchecked(q: &UnitQuaternion<N2>) -> Self
self.to_superset
but without any property checks. Always succeeds.source§impl<N1, N2> SubsetOf<Unit<Quaternion<N2>>> for UnitQuaternion<N1>where
N1: Real,
N2: Real + SupersetOf<N1>,
impl<N1, N2> SubsetOf<Unit<Quaternion<N2>>> for UnitQuaternion<N1>where
N1: Real,
N2: Real + SupersetOf<N1>,
source§fn to_superset(&self) -> UnitQuaternion<N2>
fn to_superset(&self) -> UnitQuaternion<N2>
self
to the equivalent element of its superset.source§fn is_in_subset(uq: &UnitQuaternion<N2>) -> bool
fn is_in_subset(uq: &UnitQuaternion<N2>) -> bool
element
is actually part of the subset Self
(and can be converted to it).source§unsafe fn from_superset_unchecked(uq: &UnitQuaternion<N2>) -> Self
unsafe fn from_superset_unchecked(uq: &UnitQuaternion<N2>) -> Self
self.to_superset
but without any property checks. Always succeeds.source§impl<N: Real> UlpsEq<Unit<Complex<N>>> for UnitComplex<N>
impl<N: Real> UlpsEq<Unit<Complex<N>>> for UnitComplex<N>
source§impl<N, R: Dim, C: Dim, S> UlpsEq<Unit<Matrix<N, R, C, S>>> for Unit<Matrix<N, R, C, S>>where
N: Scalar + UlpsEq,
S: Storage<N, R, C>,
N::Epsilon: Copy,
impl<N, R: Dim, C: Dim, S> UlpsEq<Unit<Matrix<N, R, C, S>>> for Unit<Matrix<N, R, C, S>>where
N: Scalar + UlpsEq,
S: Storage<N, R, C>,
N::Epsilon: Copy,
source§impl<N: Real + UlpsEq<Epsilon = N>> UlpsEq<Unit<Quaternion<N>>> for UnitQuaternion<N>
impl<N: Real + UlpsEq<Epsilon = N>> UlpsEq<Unit<Quaternion<N>>> for UnitQuaternion<N>
impl<T: Copy> Copy for Unit<T>
impl<T: Eq> Eq for Unit<T>
impl<T> StructuralEq for Unit<T>
impl<T> StructuralPartialEq for Unit<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Unit<T>where
T: RefUnwindSafe,
impl<T> Send for Unit<T>where
T: Send,
impl<T> Sync for Unit<T>where
T: Sync,
impl<T> Unpin for Unit<T>where
T: Unpin,
impl<T> UnwindSafe for Unit<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> Rand for Twhere
Standard: Distribution<T>,
impl<T> Rand for Twhere
Standard: Distribution<T>,
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.