Struct nalgebra::UnitQuaternion
[−]
[src]
pub struct UnitQuaternion<N> { /* fields omitted */ }
A unit quaternion that can represent a 3D rotation.
Methods
impl<N: BaseFloat> UnitQuaternion<N>
[src]
fn new(axisangle: Vector3<N>) -> UnitQuaternion<N>
Creates a new unit quaternion from the axis-angle representation of a rotation.
fn new_with_quaternion(q: Quaternion<N>) -> UnitQuaternion<N>
Creates a new unit quaternion from a quaternion.
The input quaternion will be normalized.
fn new_with_euler_angles(roll: N, pitch: N, yaw: N) -> UnitQuaternion<N>
Creates a new unit quaternion from Euler angles.
The primitive rotations are applied in order: 1 roll − 2 pitch − 3 yaw.
fn to_rotation_matrix(&self) -> Rotation3<N>
Builds a rotation matrix from this quaternion.
impl<N> UnitQuaternion<N>
[src]
unsafe fn new_with_unit_quaternion(q: Quaternion<N>) -> UnitQuaternion<N>
Creates a new unit quaternion from a quaternion.
This is unsafe because the input quaternion will not be normalized.
fn quaternion<'a>(&'a self) -> &'a Quaternion<N>
The Quaternion
representation of this unit quaternion.
Trait Implementations
impl<N: Eq> Eq for UnitQuaternion<N>
[src]
impl<N: PartialEq> PartialEq for UnitQuaternion<N>
[src]
fn eq(&self, __arg_0: &UnitQuaternion<N>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &UnitQuaternion<N>) -> bool
This method tests for !=
.
impl<N: Encodable> Encodable for UnitQuaternion<N>
[src]
impl<N: Decodable> Decodable for UnitQuaternion<N>
[src]
fn decode<__DN: Decoder>(__arg_0: &mut __DN) -> Result<UnitQuaternion<N>, __DN::Error>
impl<N: Clone> Clone for UnitQuaternion<N>
[src]
fn clone(&self) -> UnitQuaternion<N>
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: Hash> Hash for UnitQuaternion<N>
[src]
fn hash<__HN: Hasher>(&self, __arg_0: &mut __HN)
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> Debug for UnitQuaternion<N>
[src]
impl<N: Copy> Copy for UnitQuaternion<N>
[src]
impl<N: BaseNum> One for UnitQuaternion<N>
[src]
fn one() -> UnitQuaternion<N>
Returns the multiplicative identity element of Self
, 1
. Read more
impl<N: Copy + Neg<Output=N>> Inverse for UnitQuaternion<N>
[src]
fn inverse(&self) -> Option<UnitQuaternion<N>>
Returns the inverse of m
.
fn inverse_mut(&mut self) -> bool
In-place version of inverse
.
impl<N: Rand + BaseFloat> Rand for UnitQuaternion<N>
[src]
fn rand<R: Rng>(rng: &mut R) -> UnitQuaternion<N>
Generates a random instance of this type using the specified source of randomness. Read more
impl<N: ApproxEq<N>> ApproxEq<N> for UnitQuaternion<N>
[src]
fn approx_epsilon(_: Option<UnitQuaternion<N>>) -> N
Default epsilon for approximation.
fn approx_ulps(_: Option<UnitQuaternion<N>>) -> u32
Default ULPs for approximation.
fn approx_eq_eps(&self, other: &UnitQuaternion<N>, eps: &N) -> bool
Tests approximate equality using a custom epsilon.
fn approx_eq_ulps(&self, other: &UnitQuaternion<N>, ulps: u32) -> bool
Tests approximate equality using units in the last place (ULPs)
fn approx_eq(&self, other: &Self) -> bool
Tests approximate equality.
impl<N: BaseFloat + ApproxEq<N>> Div<UnitQuaternion<N>> for UnitQuaternion<N>
[src]
type Output = UnitQuaternion<N>
The resulting type after applying the /
operator
fn div(self, other: UnitQuaternion<N>) -> UnitQuaternion<N>
The method for the /
operator
impl<N: BaseFloat + ApproxEq<N>> DivAssign<UnitQuaternion<N>> for UnitQuaternion<N>
[src]
fn div_assign(&mut self, other: UnitQuaternion<N>)
The method for the /=
operator
impl<N: BaseNum> Mul<UnitQuaternion<N>> for UnitQuaternion<N>
[src]
type Output = UnitQuaternion<N>
The resulting type after applying the *
operator
fn mul(self, right: UnitQuaternion<N>) -> UnitQuaternion<N>
The method for the *
operator
impl<N: BaseNum> MulAssign<UnitQuaternion<N>> for UnitQuaternion<N>
[src]
fn mul_assign(&mut self, right: UnitQuaternion<N>)
The method for the *=
operator
impl<N: BaseNum> Mul<Vector3<N>> for UnitQuaternion<N>
[src]
type Output = Vector3<N>
The resulting type after applying the *
operator
fn mul(self, right: Vector3<N>) -> Vector3<N>
The method for the *
operator
impl<N: BaseNum> Mul<Point3<N>> for UnitQuaternion<N>
[src]
type Output = Point3<N>
The resulting type after applying the *
operator
fn mul(self, right: Point3<N>) -> Point3<N>
The method for the *
operator
impl<N: BaseFloat> Rotation<Vector3<N>> for UnitQuaternion<N>
[src]
fn rotation(&self) -> Vector3<N>
Gets the rotation associated with self
.
fn inverse_rotation(&self) -> Vector3<N>
Gets the inverse rotation associated with self
.
fn append_rotation_mut(&mut self, amount: &Vector3<N>)
Appends a rotation to this object.
fn append_rotation(&self, amount: &Vector3<N>) -> UnitQuaternion<N>
Appends the rotation amount
to a copy of t
.
fn prepend_rotation_mut(&mut self, amount: &Vector3<N>)
Prepends a rotation to this object.
fn prepend_rotation(&self, amount: &Vector3<N>) -> UnitQuaternion<N>
Prepends the rotation amount
to a copy of t
.
fn set_rotation(&mut self, v: Vector3<N>)
Sets the rotation of self
.
impl<N: BaseFloat> RotationMatrix<N, Vector3<N>, Vector3<N>> for UnitQuaternion<N>
[src]
type Output = Rotation3<N>
The output rotation matrix type.
fn to_rotation_matrix(&self) -> Rotation3<N>
Gets the rotation matrix represented by self
.
impl<N: BaseNum + Neg<Output=N>> Rotate<Vector3<N>> for UnitQuaternion<N>
[src]
fn rotate(&self, v: &Vector3<N>) -> Vector3<N>
Applies a rotation to v
.
fn inverse_rotate(&self, v: &Vector3<N>) -> Vector3<N>
Applies an inverse rotation to v
.
impl<N: BaseNum + Neg<Output=N>> Rotate<Point3<N>> for UnitQuaternion<N>
[src]
fn rotate(&self, p: &Point3<N>) -> Point3<N>
Applies a rotation to v
.
fn inverse_rotate(&self, p: &Point3<N>) -> Point3<N>
Applies an inverse rotation to v
.
impl<N: BaseFloat + ApproxEq<N>> RotationTo for UnitQuaternion<N>
[src]
type AngleType = N
Type of the angle between two elements.
type DeltaRotationType = UnitQuaternion<N>
Type of the rotation between two elements.
fn angle_to(&self, other: &Self) -> N
Computes an angle nedded to transform the first element to the second one using a rotation. Read more
fn rotation_to(&self, other: &Self) -> UnitQuaternion<N>
Computes the smallest rotation needed to transform the first element to the second one.
impl<N: BaseNum + Neg<Output=N>> Transform<Vector3<N>> for UnitQuaternion<N>
[src]
fn transform(&self, v: &Vector3<N>) -> Vector3<N>
Applies a transformation to v
.
fn inverse_transform(&self, v: &Vector3<N>) -> Vector3<N>
Applies an inverse transformation to v
.
impl<N: BaseNum + Neg<Output=N>> Transform<Point3<N>> for UnitQuaternion<N>
[src]
fn transform(&self, p: &Point3<N>) -> Point3<N>
Applies a transformation to v
.
fn inverse_transform(&self, p: &Point3<N>) -> Point3<N>
Applies an inverse transformation to v
.
impl<N: Display> Display for UnitQuaternion<N>
[src]
impl<N> Dimension for UnitQuaternion<N>
[src]
fn dimension(_: Option<UnitQuaternion<N>>) -> usize
The dimension of the object.