Type Definition nalgebra::geometry::UnitQuaternion

source ·
pub type UnitQuaternion<N> = Unit<Quaternion<N>>;
Expand description

A unit quaternions. May be used to represent a rotation.

Implementations§

👎Deprecated: This method is a no-op and will be removed in a future release.

Moves this unit quaternion into one that owns its data.

👎Deprecated: This method is a no-op and will be removed in a future release.

Clones this unit quaternion into one that owns its data.

The rotation angle in [0; pi] of this unit quaternion.

The underlying quaternion.

Same as self.as_ref().

Compute the conjugate of this unit quaternion.

Inverts this quaternion if it is not zero.

The rotation angle needed to make self and other coincide.

The unit quaternion needed to make self and other coincide.

The result is such that: self.rotation_to(other) * self == other.

Linear interpolation between two unit quaternions.

The result is not normalized.

Normalized linear interpolation between two unit quaternions.

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).

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 return None.

Compute the conjugate of this unit quaternion in-place.

Inverts this quaternion if it is not zero.

The rotation axis of this unit quaternion or None if the rotation is zero.

The rotation axis of this unit quaternion multiplied by the rotation angle.

The rotation axis and angle in ]0, pi] of this unit quaternion.

Returns None if the angle is zero.

Compute the exponential of a quaternion.

Note that this function yields a Quaternion<N> because it looses the unit property.

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.

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.

Builds a rotation matrix from this unit quaternion.

Converts this unit quaternion into its equivalent Euler angles.

The angles are produced in the form (roll, yaw, pitch).

Converts this unit quaternion into its equivalent homogeneous transformation matrix.

The quaternion multiplicative identity.

Creates a new quaternion from a unit vector (the rotation axis) and an angle (the rotation angle).

Creates a new unit quaternion from a quaternion.

The input quaternion will be normalized.

Creates a new unit quaternion from Euler angles.

The primitive rotations are applied in order: 1 roll − 2 pitch − 3 yaw.

Builds an unit quaternion from a rotation matrix.

The unit quaternion needed to make a and b be collinear and point toward the same direction.

The smallest rotation needed to make a and b collinear and point toward the same direction, raised to the power s.

The unit quaternion needed to make a and b be collinear and point toward the same direction.

The smallest rotation needed to make a and b collinear and point toward the same direction, raised to the power s.

Creates an unit quaternion that corresponds to the local frame of an observer standing at the origin and looking toward dir.

It maps the view direction dir to the positive z axis.

Arguments
  • dir - The look direction, that is, direction the matrix z axis will be aligned with.
  • up - The vertical direction. The only requirement of this parameter is to not be collinear to dir. Non-collinearity is not checked.

Builds a right-handed look-at view matrix without translation.

This conforms to the common notion of right handed look-at matrix from the computer graphics community.

Arguments
  • eye - The eye position.
  • target - The target position.
  • up - A vector approximately aligned with required the vertical axis. The only requirement of this parameter is to not be collinear to target - eye.

Builds a left-handed look-at view matrix without translation.

This conforms to the common notion of left handed look-at matrix from the computer graphics community.

Arguments
  • eye - The eye position.
  • target - The target position.
  • up - A vector approximately aligned with required the vertical axis. The only requirement of this parameter is to not be collinear to target - eye.

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.

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.

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).

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(axisangle).

Trait Implementations§

Used for specifying relative comparisons.
The default tolerance to use when testing values that are close together. Read more
A test for equality that uses the absolute difference to compute the approximate equality of two numbers. Read more
The inverse of ApproxEq::abs_diff_eq.
Performs an operation.
Performs specific operation.
Checks whether operating with the identity element is a no-op for the given argument. Approximate equality is used for verifications. Read more
Returns true if latin squareness holds for the given arguments. Approximate equality is used for verifications. Read more
Returns true if associativity holds for the given arguments. Approximate equality is used for verifications. Read more
Type of the first rotation to be applied.
Type of the non-uniform scaling to be applied.
The type of the pure translation part of this affine transformation.
Decomposes this affine transformation into a rotation followed by a non-uniform scaling, followed by a rotation, followed by a translation. Read more
Appends a translation to this similarity.
Prepends a translation to this similarity.
Appends a rotation to this similarity.
Prepends a rotation to this similarity.
Appends a scaling factor to this similarity.
Prepends a scaling factor to this similarity.
Appends to this similarity a rotation centered at the point p, i.e., this point is left invariant. Read more
Formats the value using the given formatter. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
The identity element.
Specific identity.
Returns the inverse of self, relative to the operator O.
In-place inversin of self.
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Returns the multiplicative identity element of Self, 1. Read more
Sets self to the multiplicative identity element of Self, 1.
Returns true if self is equal to the multiplicative identity. Read more
Applies this group’s inverse action on a point from the euclidean space.
Applies this group’s inverse action on a vector from the euclidean space. Read more
The default relative tolerance for testing values that are far-apart. Read more
A test for equality that uses a relative comparison if the values are far apart.
The inverse of ApproxEq::relative_eq.
Raises this rotation to a power. If this is a simple rotation, the result must be equivalent to multiplying the rotation angle by n. Read more
Computes a simple rotation that makes the angle between a and b equal to zero, i.e., b.angle(a * delta_rotation(a, b)) = 0. If a and b are collinear, the computed rotation may not be unique. Returns None if no such simple rotation exists in the subgroup represented by Self. Read more
Computes the rotation between a and b and raises it to the power n. Read more
The type of the pure (uniform) scaling part of this similarity transformation.
The pure translational component of this similarity transformation.
The pure rotational component of this similarity transformation.
The pure scaling component of this similarity transformation.
Applies this transformation’s pure translational part to a point.
Applies this transformation’s pure rotational part to a point.
Applies this transformation’s pure scaling part to a point.
Applies this transformation’s pure rotational part to a vector.
Applies this transformation’s pure scaling part to a vector.
Applies this transformation inverse’s pure translational part to a point.
Applies this transformation inverse’s pure rotational part to a point.
Applies this transformation inverse’s pure scaling part to a point.
Applies this transformation inverse’s pure rotational part to a vector.
Applies this transformation inverse’s pure scaling part to a vector.
The inclusion map: converts self to the equivalent element of its superset.
Checks if element is actually part of the subset Self (and can be converted to it).
Use with care! Same as self.to_superset but without any property checks. Always succeeds.
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
The inclusion map: converts self to the equivalent element of its superset.
Checks if element is actually part of the subset Self (and can be converted to it).
Use with care! Same as self.to_superset but without any property checks. Always succeeds.
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
The inclusion map: converts self to the equivalent element of its superset.
Checks if element is actually part of the subset Self (and can be converted to it).
Use with care! Same as self.to_superset but without any property checks. Always succeeds.
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
The inclusion map: converts self to the equivalent element of its superset.
Checks if element is actually part of the subset Self (and can be converted to it).
Use with care! Same as self.to_superset but without any property checks. Always succeeds.
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
The inclusion map: converts self to the equivalent element of its superset.
Checks if element is actually part of the subset Self (and can be converted to it).
Use with care! Same as self.to_superset but without any property checks. Always succeeds.
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
The inclusion map: converts self to the equivalent element of its superset.
Checks if element is actually part of the subset Self (and can be converted to it).
Use with care! Same as self.to_superset but without any property checks. Always succeeds.
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Applies this group’s action on a point from the euclidean space.
Applies this group’s action on a vector from the euclidean space. Read more
The default ULPs to tolerate when testing values that are far-apart. Read more
A test for equality that uses units in the last place (ULP) if the values are far apart.
The inverse of ApproxEq::ulps_eq.