Citizendia
Your Ad Here

Spatial rotations in three dimensions can be parametrized using both Euler angles and unit quaternions. In Mathematics and its applications a coordinate system is a system for assigning an n - Tuple of Numbers or scalars to each point 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 Unit quaternions provide a convenient mathematical notation for representing Orientations and Rotations of objects in three dimensions 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. Sir William Rowan Hamilton (4 August 1805 &ndash 2 September 1865 was an Irish Mathematician, Physicist, and Astronomer who In Recreational mathematics, a magic square of order n is an arrangement of n ² numbers usually distinct Integers in a square, such For this reason the dynamics community commonly refers to quaternions in this application as "Euler parameters".

Contents

Definition

A unit quaternion can be described as:

\mathbf{q} = \begin{bmatrix} q_0 & q_1 & q_2 & q_3 \end{bmatrix}^T
|\mathbf{q}|^2 = q_0^2 + q_1^2 + q_2^2 + q_3^2 = 1

We can associate a quaternion to a rotation around an axis by the following expression

\mathbf{q}_0 = \cos(\alpha/2)
\mathbf{q}_1 = \sin(\alpha/2)\cos(\beta_x)
\mathbf{q}_2 = \sin(\alpha/2)\cos(\beta_y)
\mathbf{q}_3 = \sin(\alpha/2)\cos(\beta_z)

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). In Mathematics, a unit vector in a Normed vector space is a vector (often a spatial vector) whose length is 1 (the unit length

Rotation matrices

Euler angles - The xyz (fixed) system is shown in blue, the XYZ (rotated) system is shown in red. The line of nodes, labelled N, is shown in green.
Euler angles - The xyz (fixed) system is shown in blue, the XYZ (rotated) system is shown in red. The line of nodes, labelled N, is shown in green.

The orthogonal matrix corresponding to a rotation by the unit quaternion q is given by

\begin{bmatrix}
 1- 2(q_2^2 + q_3^2) &  2(q_1 q_2 - q_0 q_3) &  2(q_0 q_2 + q_1 q_3) \\
2(q_1 q_2 + q_0 q_3) & 1 - 2(q_1^2 + q_3^2)  &  2(q_2 q_3 - q_0 q_1) \\
2(q_1 q_3 - q_0 q_2) & 2( q_0 q_1 + q_2 q_3) &  1 - 2(q_1^2 + q_2^2)
\end{bmatrix}

The orthogonal matrix corresponding to a rotation with Euler angles φ,θ,ψ, with x-y-z convention, is given by

\begin{bmatrix}
\cos\theta \cos\psi & -\cos\phi \sin\psi + \sin\phi \sin\theta \cos\psi &   \sin\phi \sin\psi + \cos\phi \sin\theta \cos\psi \\
\cos\theta \sin\psi &  \cos\phi \cos\psi + \sin\phi \sin\theta \sin\psi & -\sin\phi \cos\psi + \cos\phi \sin\theta \sin\psi \\
-\sin\theta             &  \sin\phi \cos\theta                                          &   \cos\phi \cos\theta \\
\end{bmatrix}

Conversion

By comparing the terms in the two matrices, we get

 \mathbf{q} = \begin{bmatrix}
\cos (\phi /2) \cos (\theta /2) \cos (\psi /2) +  \sin (\phi /2) \sin (\theta /2) \sin (\psi /2) \\
\sin (\phi /2) \cos (\theta /2) \cos (\psi /2) -  \cos (\phi /2) \sin (\theta /2) \sin (\psi /2) \\
\cos (\phi /2) \sin (\theta /2) \cos (\psi /2) +  \sin (\phi /2) \cos (\theta /2) \sin (\psi /2) \\
\cos (\phi /2) \cos (\theta /2) \sin (\psi /2) -  \sin (\phi /2) \sin (\theta /2) \cos (\psi /2) \\
\end{bmatrix}

For Euler angles we get:

\begin{bmatrix}
\phi \\ \theta \\ \psi
\end{bmatrix} =
\begin{bmatrix}
\mbox{arctan} \frac {2(q_0 q_1 + q_2 q_3)} {1 - 2(q_1^2 + q_2^2)} \\
\mbox{arcsin} (2(q_0 q_2 - q_3 q_1)) \\
\mbox{arctan} \frac {2(q_0 q_3 + q_1 q_2)} {1 - 2(q_2^2 + q_3^2)}
\end{bmatrix}

Relationship with Tait-Bryan angles

Similarly for Euler angles, we use the Tait-Bryan angles (in terms of flight dynamics):

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). In Matrix theory, a real orthogonal matrix is a square matrix Q whose Transpose is its inverse: Q^T In Matrix theory, a real orthogonal matrix is a square matrix Q whose Transpose is its inverse: Q^T 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 The Tait-Bryan rotations, named after Peter Guthrie Tait and George Bryan. Flight dynamics is the science of air and space vehicle orientation and control in three dimensions Nevertheless, it is not easy to find a matrix expression with Tait-Bryan angles because its final expression depends on how the rotations are applied.

Singularities

One must be aware of singularities in the Euler angle parametrization when the pitch approaches \pm 90^o (north/south pole). These cases must be handled specially. The common name for this situation is gimbal lock. Gimbal lock occurs when the axes of two of the three Gimbals needed to compensate for Rotations in three dimensional space are driven to the same direction

Code to handle the singularities is derived on this site: www.euclideanspace.com

See also

Unit quaternions provide a convenient mathematical notation for representing Orientations and Rotations of objects in three dimensions
© 2009 citizendia.org; parts available under the terms of GNU Free Documentation License, from http://en.wikipedia.org
Dapyx Software network: MP3 Explorer | Ebook Manager | Zenithic