- Conversion between quaternions and Euler angles
Spatial rotations in three dimensions can be parametrized using both Euler angles and unit quaternions. This article explains how to convert between the two representations. Actually this simple use of "quaternions" was first presented by Euler some seventy years earlier than Hamilton to solve the problem of magic squares. For this reason the dynamics community commonly refers to quaternions in this application as "Euler parameters".
A unit quaternion can be described as:
We can associate a quaternion with a rotation around an axis by the following expression
where α is a simple rotation angle (the value in radians of the angle of rotation) and cos(βx), cos(βy) and cos(βz) are the "direction cosines" locating the axis of rotation (Euler's Theorem).
or equivalently, by the homogeneous expression
If q0 + iq1 + jq2 + kq3 is not a unit quaternion then the homogeneous form is still a scalar multiple of a rotation matrix, while the inhomogeneous form is in general no longer an orthogonal matrix. This is why in numerical work the homogeneous form is to be preferred if distortion is to be avoided.
By combining the quaternion representations of the Euler rotations we get
For Euler angles we get:
arctan and arcsin have a result between −π/2 and π/2. With three rotation between −π/2 and π/2 you can't have all possible orientations. You need to replace the arctan by atan2 to generate all the orientation.
Relationship with Tait–Bryan angles
Similarly for Euler angles, we use the Tait–Bryan angles (in terms of flight dynamics):
- Roll – ϕ: rotation about the X-axis
- Pitch – θ: rotation about the Y-axis
- Yaw – ψ: rotation about the Z-axis
where the X-axis points forward, Y-axis to the right and Z-axis downward and in the example to follow the rotation occurs in the order yaw, pitch, roll (about body-fixed axes).
One must be aware of singularities in the Euler angle parametrization when the pitch approaches ±90° (north/south pole). These cases must be handled specially. The common name for this situation is gimbal lock.
Code to handle the singularities is derived on this site: www.euclideanspace.com
- Rotation operator (vector space)
- Quaternions and spatial rotation
- Euler Angles
- Rotation matrix
- Rotation representation (mathematics)
- Q60. How do I convert Euler rotation angles to a quaternion? and related questions at The Matrix and Quaternions FAQ
Wikimedia Foundation. 2010.
Look at other dictionaries:
Euler angles — The Euler angles were developed by Leonhard Euler to describe the orientation of a rigid body (a body in which the relative position of all its points is constant) in 3 dimensional Euclidean space. To give an object a specific orientation it may… … Wikipedia
Quaternions and spatial rotation — Unit quaternions provide a convenient mathematical notation for representing orientations and rotations of objects in three dimensions. Compared to Euler angles they are simpler to compose and avoid the problem of gimbal lock. Compared to… … Wikipedia
Rotation representation (mathematics) — In geometry a rotation representation expresses the orientation of an object (or coordinate frame) relative to a coordinate reference frame. This concept extends to classical mechanics where rotational (or angular) kinematics is the science of… … Wikipedia
Dual quaternion — The set of dual quaternions is an algebra that can be used to represent spatial rigid body displacements. A dual quaternion is an ordered pair of quaternions Â = (A, B) and therefore is constructed from eight real parameters. Because rigid… … Wikipedia
List of mathematics articles (C) — NOTOC C C closed subgroup C minimal theory C normal subgroup C number C semiring C space C symmetry C* algebra C0 semigroup CA group Cabal (set theory) Cabibbo Kobayashi Maskawa matrix Cabinet projection Cable knot Cabri Geometry Cabtaxi number… … Wikipedia
Quaternion — Quaternions, in mathematics, are a non commutative extension of complex numbers. They were first described by the Irish mathematician Sir William Rowan Hamilton in 1843 and applied to mechanics in three dimensional space. They find uses in both… … Wikipedia
Rotation matrix — In linear algebra, a rotation matrix is a matrix that is used to perform a rotation in Euclidean space. For example the matrix rotates points in the xy Cartesian plane counterclockwise through an angle θ about the origin of the Cartesian… … Wikipedia
logic, history of — Introduction the history of the discipline from its origins among the ancient Greeks to the present time. Origins of logic in the West Precursors of ancient logic There was a medieval tradition according to which the Greek philosopher … Universalium