Representing Attitude: Euler Angles, Unit Quaternions, and Rotation

Representing Attitude: Euler Angles, Unit Quaternions, and Rotation
Vectors
James Diebel
Stanford University
Stanford, California 94301–9010
Email: [email protected]
20 October 2006
Abstract
We present the three main mathematical constructs used to represent the attitude of a rigid body in threedimensional space. These are (1) the rotation matrix, (2) a triple of Euler angles, and (3) the unit quaternion. To
these we add a fourth, the rotation vector, which has many of the benefits of both Euler angles and quaternions, but
neither the singularities of the former, nor the quadratic constraint of the latter. There are several other subsidiary
representations, such as Cayley-Klein parameters and the axis-angle representation, whose relations to the three main
representations are also described. Our exposition is catered to those who seek a thorough and unified reference on
the whole subject; detailed derivations of some results are not presented.
Keywords–Euler angles, quaternion, Euler-Rodrigues parameters, Cayley-Klein parameters, rotation matrix, direction cosine matrix, transformation matrix, Cardan angles, Tait-Bryan angles, nautical angles, rotation vector,
orientation, attitude, roll, pitch, yaw, bank, heading, spin, nutation, precession, Slerp
1
Contents
1 Introduction
1.1 Overview of Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3 Coordinate Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4
4
4
4
2 Rotation Matrix
2.1 Coordinate Transformations . .
2.2 Transformation Matrix . . . . .
2.3 Pose of a Rigid Body . . . . . .
2.4 Coordinate Rotations . . . . .
2.5 Direction Cosine Matrix . . . .
2.6 Basis Vectors . . . . . . . . . .
2.7 Rotation Matrix Multiplication
.
.
.
.
.
.
.
4
5
5
5
5
5
6
6
3 Kinematics
3.1 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2 Motion of a Fixed Point on a Rigid Body . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3 Motion of a Particle in a Moving Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6
6
7
7
4 Finite Difference Approximations
7
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
5 Euler Angles
5.1 Rotation Sequence . . . . . . . . . . . . . . . . . .
5.2 Euler Angle Rates and Angular Velocity . . . . . .
5.3 Linearization . . . . . . . . . . . . . . . . . . . . .
5.4 Valid Rotation Sequences . . . . . . . . . . . . . .
5.5 Euler Angle Sequence (3,1,3) . . . . . . . . . . . .
5.5.1 Usage . . . . . . . . . . . . . . . . . . . . .
5.5.2 Euler Angles ⇒ Rotation Matrix . . . . . .
5.5.3 Euler Angles ⇐ Rotation Matrix . . . . . .
5.5.4 Euler Angles ⇒ Euler Angle Rates Matrices
5.5.5 Euler Angles ⇒ Unit Quaternion . . . . . .
5.5.6 Singularities . . . . . . . . . . . . . . . . . .
5.6 Euler Angle Sequence (1,2,3) . . . . . . . . . . . .
5.6.1 Usage . . . . . . . . . . . . . . . . . . . . .
5.6.2 Euler Angles ⇒ Rotation Matrix . . . . . .
5.6.3 Euler Angles ⇐ Rotation Matrix . . . . . .
5.6.4 Euler Angles ⇒ Euler Angle Rates Matrices
5.6.5 Euler Angles ⇒ Unit Quaternion . . . . . .
5.6.6 Singularities . . . . . . . . . . . . . . . . . .
5.7 Derivatives of Selected Trigonometric Functions . .
5.8 Singularities . . . . . . . . . . . . . . . . . . . . . .
5.9 Intra-Euler-Angle Conversion . . . . . . . . . . . .
5.9.1 Sequence (3,1,3) ⇐ Sequence (1,2,3) . . . .
5.9.2 Sequence (1,2,3) ⇐ Sequence (3,1,3) . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
7
7
9
9
9
10
10
10
10
10
11
11
11
11
11
12
12
12
13
13
13
13
13
13
6 Quaternions
6.1 General Quaternions . . . . . . . . . . . . . .
6.2 Quaternion Multiplication . . . . . . . . . . .
6.3 Quaternion ⇒ Quaternion Matrices . . . . .
6.4 Unit Quaternion ⇒ Rotation Matrix . . . . .
6.5 Unit Quaternion ⇐ Rotation Matrix . . . . .
6.6 Quaternion Rates ⇒ Angular Velocity . . . .
6.7 Quaternion Rates ⇐ Angular Velocity . . . .
6.8 Quaternion Rates ⇒ Angular Acceleration . .
6.9 Quaternion Rates ⇐ Angular Acceleration . .
6.10 Unit Quaternion ⇐ Cayley-Klein Parameters
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
14
14
14
14
15
15
16
16
16
16
16
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
2
6.11
6.12
6.13
6.14
6.15
6.16
Unit Quaternion ⇒ Cayley-Klein Parameters
Unit Quaternion ⇐ Axis-Angle . . . . . . . .
Unit Quaternion ⇒ Axis-Angle . . . . . . . .
Unit Quaternion ⇐ Euler Angles . . . . . . .
Unit Quaternion ⇒ Euler Angles . . . . . . .
Optimization with Quaternions . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
17
17
18
18
18
18
7 Rotation Vector Representation
7.1 Rotation Vector ⇐ Axis-Angle . . . . . . . . .
7.2 Rotation Vector ⇒ Axis-Angle . . . . . . . . .
7.3 Rotation Vector ⇒ Unit Quaternion . . . . . .
7.4 Rotation Vector ⇐ Unit Quaternion . . . . . .
7.5 Rotation Vector ⇒ Quaternion Matrices . . . .
7.6 Rotation Vector ⇒ Quaternion Rates Matrices
7.7 Rotation Vector ⇒ Rotation Matrix . . . . . .
7.8 Rotation Vector Multiplication . . . . . . . . .
7.9 Rotation Vector Rates ⇒ Quaternion Rates . .
7.10 Rotation Vector Rates ⇒ Angular Velocity . .
7.11 Rotation Vector Rates ⇐ Angular Velocity . .
7.12 Integration of Angular Velocity . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
18
18
18
19
19
19
20
20
21
21
21
21
21
8 A Catalog of Euler Angle Parameterizations
8.1 Euler Angle Sequence (1,2,1) . . . . . . . . .
8.2 Euler Angle Sequence (1,2,3) . . . . . . . . .
8.3 Euler Angle Sequence (1,3,1) . . . . . . . . .
8.4 Euler Angle Sequence (1,3,2) . . . . . . . . .
8.5 Euler Angle Sequence (2,1,2) . . . . . . . . .
8.6 Euler Angle Sequence (2,1,3) . . . . . . . . .
8.7 Euler Angle Sequence (2,3,1) . . . . . . . . .
8.8 Euler Angle Sequence (2,3,2) . . . . . . . . .
8.9 Euler Angle Sequence (3,1,2) . . . . . . . . .
8.10 Euler Angle Sequence (3,1,3) . . . . . . . . .
8.11 Euler Angle Sequence (3,2,1) . . . . . . . . .
8.12 Euler Angle Sequence (3,2,3) . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
22
23
24
25
26
27
28
29
30
31
32
33
34
.
.
.
.
.
.
.
.
.
.
.
.
3
1
Introduction
ventions. Quaternions, especially unit quaternions and the
axis-angle representation, are discussed in Sec. 6. The roThis document is intended as a unified reference on the tation vector is developed in Sec. 7 as a three-dimensional
subject of parameterizing the attitude of an object in three- parametrization of a quaternion. Finally, a catalog of the
dimensional space. It has been written to fill a perceived twelve different Euler angle parameterizations is presented
gap in the existing on-line literature. In particular, while in Sec. 8. Throughout this report, conversions between
there are many web pages and technical reports dedicated the various representations, and explanatory notes regardto the subject of Euler angles and quaternions, we were un- ing usage and naming conventions are included where apable to find any single reference that covers all the topics propriate.
with a consistent, detailed, and unified treatment. This
problem is exacerbated by the numerous conventions in
current use, and the tendency among authors to assume a 1.2 Sources
particular convention without explicitly stating their choice, The mathematical results in this report have been derived
and without commenting on the alternatives. Further- from basic definitions and first principles. Several sources
more, the existing on-line literature has a particularly large have been used to confirm our results and to provide inforgap in the area of the various possible choices of Euler an- mation on the usage of the various conventions. On Euler
gle triples.
angles, we cite [1] and [4]. On Caley-Klein parameters, we
The most common way to represent the attitude of a cite [3]. On quaternions and Euler-Rodrigues parameters,
rigid body is a set of three Euler angles. These are popular we cite [5] and [2], especially the latter. On Kinematics,
because they are easy to understand and easy to use. Some we cite [1].
sets of Euler angles are so widely used that they have names
that have become part of the common parlance, such as the
roll, pitch, and yaw of an airplane. The main disadvantages 1.3 Coordinate Systems
of Euler angles are: (1) that certain important functions
We consider the relationships between data expressed in
of Euler angles have singularities, and (2) that they are
two different coordinate systems:
less accurate than unit quaternions when used to integrate
incremental changes in attitude over time.
• The world coordinate system is fixed in inertial space.
These deficiencies in the Euler angle representation have
The origin of this coordinate system is denotedxw .
led researchers to use unit quaternions as a parametrization of the attitude of a rigid body. The relevant functions
• The body-fixed coordinate system is rigidly attached
of unit quaternions have no singularities and the represento the object whose attitude we would like to detation is well-suited to integrating the angular velocity of
scribe. The origin of this coordinate system is dea body over time. The main disadvantages of using unit
noted xb .
quaternions are: (1) that the four quaternion parameters
Points and vectors expressed in the body-fixed coordido not have intuitive physical meanings, and (2) that a
quaternion must have unity norm to be a pure rotation. nates are distinguished from those expressed in the world
The unity norm constraint, which is quadratic in form, is coordinates by a prime symbol. For example, if x is a
particularly problematic if the attitude parameters are to point is the world coordinates, then x0 is the same point
be included in an optimization, as most standard optimiza- expressed in the body-fixed coordinates. Needless to say,
xw and x0b are both zero, but x0w and xb are generally not.
tion algorithms cannot encode such constraints.
As an alternative to Euler angles and the unit quater- Here, x0w is the origin of the world coordinates expressed
nion, we offer the rotation vector. The rotation vector in the body-fixed coordinates, and xb is the origin of the
lacks both the singularities of the Euler angles and the body-fixed coordinates expressed in the world coordinates.
Some of the mathematics described in this document
quadratic constraint of the unit quaternion. This is not a
new parametrization, but we have found the existing refer- only apply when the world coordinate system is rotationences on this subject to be lacking in detail. The rotation ally fixed. For many purposes, however, it is perfectly acvector is particularly useful when seeking to optimize over ceptable to consider a slowly-rotating coordinate system,
the attitude parameters in cases in which the Euler angle such as one attached to Earth, to be a valid world coordisingularities cannot be avoided by careful design. It may nate system, despite its non-zero angular velocity.
not be the best choice in other circumstances.
1.1
2
Overview of Contents
Rotation Matrix
A rotation matrix is a matrix whose multiplication with a
vector rotates the vector while preserving its length. The
special orthogonal group of all 3 × 3 rotation matrices is
denoted by SO(3). Thus, if R ∈ SO(3), then
In Sec. 1.3 we define the coordinate systems that are used
throughout this report. Sec. 2 introduces the idea of rotation matrices and describes several of their key properties.
Rigid-body kinematics are introduced in Sec. 3. Euler angles are discussed in all their diversity in Sec. 5, including
detailed discussions of the three most commonly-used con-
det R = ±1
4
and
R−1 = RT .
(1)
Rotation matrices for which det R = 1 are called proper 2.2 Transformation Matrix
and those for which det R = −1 are called improper. Improper rotations are also known as rotoinversions, and con- It is quite common in the computer graphics community
sist of a rotation followed by an inversion operation. We to write Eqs. 6 and 7 as matrix-vector products:
· 0 ¸ ·
¸·
¸
restrict our analysis to proper rotations, as improper rotaR x0w
x
x
=
(10)
tions are not rigid-body transformations.
1
1
0T
1
We reference the elements of a rotation matrix as fol·
¸·
¸
R −Rxb
x
lows:
=
(11)
1
0T
1
£
¤
R = r1 r2 r3
(2)


·
¸ · T
¸· 0 ¸
r11 r12 r13
x
R
xb
x
=
(12)
=  r21 r22 r23  .
(3)
1
1
0T
1
r31 r32 r33
· T
¸
·
¸
R
−RT x0w
x0
=
.
(13)
T
1
0
1
There are two possible conventions for defining the rotation matrix that encodes the attitude of a rigid body
The substantial popularity of this convention is probably
and both are in current use. Some authors prefer to write
due to its adoption by the manufacturers of 3D-accelerated
the matrix that maps from the body-fixed coordinates to
graphics hardware.
the world coordinates; others prefer the matrix that maps
from the world coordinates to the body-fixed coordinates.
Though converting between the two conventions is as 2.3 Pose of a Rigid Body
trivial as performing the transpose of a matrix, it is necThe pose of a rigid body is the position and attitude of
essary to be sure that two different sources are using the
that body. The bulk of this report deals with parameterisame convention before using results from both sources tozations of attitude. The position is most naturally encoded
gether. Indeed, one of the motivations of this report is to
by xb , the position of the origin of the body-fixed coordiprovide a single coherent reference that covers the entire
nates as expressed in world coordinates. It is, however,
subject.
equally valid to store x0w , the position of the origin of the
world coordinates as expressed in the body-fixed coordinates. The two are related to one another through the
2.1 Coordinate Transformations
attitude of the body, according to Eqs. 8 and 9.
We define the rotation matrix that encodes the attitude of
a rigid body to be the matrix that when pre-multiplied by 2.4 Coordinate Rotations
a vector expressed in the world coordinates yields the same
vector expressed in the body-fixed coordinates. That is, if A coordinate rotation is a rotation about a single coordiz ∈ R3 is a vector in the world coordinates and z0 ∈ R3 is nate axis. Enumerating the x-, y-, and z-axes with 1,2,
the same vector expressed in the body-fixed coordinates, and 3, the coordinate rotations, Ri : R → SO(3), for
i ∈ {1, 2, 3}, are
then the following relations hold:


1
0
0
z0 = R z
(4)
R1 (α) =  0 cos (α) sin (α) 
(14)
z = RT z0 .
(5)
0 − sin (α) cos (α)


cos (α) 0 − sin (α)
These expression apply to vectors, relative quantities lack
0
1
0
(15)
R2 (α) = 
ing a position in space. To transform a point from one
sin
(α)
0
cos
(α)
coordinate system to the other we must subtract the offset


to the origin of the target coordinate system before applycos (α) sin (α) 0
ing the rotation matrix. Thus, if x ∈ R3 is a point in the
R3 (α) =  − sin (α) cos (α) 0  .
(16)
world coordinates and x0 ∈ R3 is the same point expressed
0
0
1
in the body-fixed coordinates, then we may write
A sample rotation of this form is illustrated in Fig. 1,
x0 = R (x − xb ) = R x + x0w
(6) which shows a rotation about the z-axis by an angle α.
x = RT (x0 − x0w ) = RT x0 + xb .
(7)
2.5
Substituting x = 0 into Eq. 6 and x0 = 0 into Eq. 7 yields
x0w = −R xb
(8)
xb = −RT x0w .
(9)
Direction Cosine Matrix
A rotation matrix may also be referred to as a direction
cosine matrix, because the elements of this matrix are the
cosines of the unsigned angles between the body-fixed axes
and the world axes. Denoting the world axes by (x, y, z)
5
2.7
y
y′
Rotation Matrix Multiplication
The multiplication of two rotation matrices yields another
rotation matrix whose application to a point effects the
same rotation as the sequential application of the two original rotation matrices. For example, let
α
T
T
[x′1 y′1 0] = R3(α) [x1 y1 0]
y1
x′
z0 = Ra z
z00 = Rb/a z0 = Rb/a Ra z = Rb z,
(19)
(20)
Rb = Rb/a Ra .
(21)
where
y′
1
α
x′1
x
z, z′
Note that the rotations are applied in the reverse order.
That is, here we apply Ra first, followed by Rb/a .
x
1
3
Figure 1: A sample coordinate rotation about the z-axis
by an angle α.
Kinematics is the study of the motion of particles and rigid
bodies, irrespective of the forces and moments involved.
As such, it is the study of the nature of three-dimensional
space, and falls at least partially into the scope of this
report. In this section, we present, without derivation,
several key results.
and the body-fixed axes by (x0 , y 0 , z 0 ), let θx0 ,y be, for example, the unsigned angle between the x0 -axis and the yaxis. In terms of these angles, the rotation matrix may be
written

cos(θx0 ,x )
R =  cos(θy0 ,x )
cos(θz0 ,x )
cos(θx0 ,y )
cos(θy0 ,y )
cos(θz0 ,y )

cos(θx0 ,z )
cos(θy0 ,z )  .
cos(θz0 ,z )
3.1
(17)
cos(θx0 ,x ) cos(θx0 ,y ) 0
R =  cos(θy0 ,x ) cos(θy0 ,y ) 0
0
0
1

π
cos(α)
cos( 2 − α)
cos(α)
=  cos( π2 + α)
0
0


cos(α) sin(α) 0
=  − sin(α) cos(α) 0  .
0
0
1
Notation
We consider the motion of a body, b, and a particle, p,
in the world coordinate system, w. We present expressions
for the velocity and acceleration of p in terms of the motion
of b with respect to w, and the motion of p with respect to
b. We define the relevant terms here.
All of these quantities may be expressed in either the
world coordinates or the body-fixed coordinates, whichever
is more convenient. Body-fixed quantities are noted with
a prime symbol. Conversions of vectors between the two
coordinate systems are carried out according to Eqs. 4 and
5, and conversions of points are performed with Eqs. 6 and
7. All the quantities defined here are vector quantities,
except xp and xb , which are points.
To illustrate this with a concrete example, consider the case
shown in Fig. 1. Here, θx0 ,x = θy0 ,y = α, θx0 ,y = π2 − α,
θy0 ,x = π2 + α, θz0 ,z = 0, and θz0 ,{x,y} = θ{x0 ,y0 },z = π2 .
Expanding Eq. 17,

Kinematics



0
0 
1
• xb , ẋb , and ẍb are the position, velocity, and acceleration of b.
(18)
• xp , ẋp , and ẍp are the position, velocity, and acceleration of p.
This is the same result that is presented in Eq. 16 in Sec.
2.4.
• xp/b , ẋp/b , and ẍp/b are the position, velocity, and
acceleration of p relative to b (i.e., as seen by an observer rigidly attached to b).
2.6
• ω and ω̇ are the angular velocity and angular acceleration of b.
Basis Vectors
The rotation matrix may also be thought of as the ma• R is the rotation matrix of b, whose application is
trix of basis vectors that define the world and body-fixed
illustrated in Eqs. 4-7.
coordinate systems. The rows of the rotation matrix are
Given these definitions, we consider two main cases.
the basis vectors of the body-fixed coordinates expressed
in world coordinates, and the columns are the basis vec- The first deals with a point rigidly attached to the body,
tors of the world coordinates expressed in the body-fixed and the second deals with a particle moving with respect
to it.
coordinates.
6
3.2
Motion of a Fixed Point on a Rigid Again, we may reconfigure this to yield a more useful final
expression:
Body
·
£
¤
ẍp = ẍb + R C(ω̇0 ) + C(ω0 )2 x0p/b
¸
0
0 0
+ ẍp/b + 2C(ω )ẋp/b .
Let p be rigidly attached to the body, b, such that ẋp/b =
ẍp/b = 0. The velocity of the point, p, is then
T
ẋp = ẋb + ω × xp/b
= ẋb + C(ω) xp/b ,
(30)
(22)
From these results, it can be seen that Eqs. 28-30 are strict
where the skew-symmetric cross product matrix function generalizations of Eqs. 22 and 24 and Eqs. 25 and 26.
C : R3 → R3×3 is defined by


4 Finite Difference Approximations
0
−ω3 ω2
0
−ω1  .
C(ω) =  ω3
(23) At several points in this paper the angular velocity of a
−ω2 ω1
0
rigid body is related to the time derivative of the the attitude parameters. In many applications, it is necessary to
Alternatively, we may express the velocity in more conve- approximate these time derivatives using finite difference
nient terms by using a combination of world and body-fixed approximations. In this section, the most common and
terms:
useful finite difference approximations are presented and
³
´
discussed.
T
0
0
ẋp = ẋb + R ω × xp/b
We will discuss a general time-varying vector quantity,
n
approximations are denoted
= ẋb + RT C(ω0 ) x0p/b .
(24) z (t) ∈ R . Finite difference
with the operator ∆nS,h , where n is the order of the derivative, S is the stencil over which the finite difference apThe acceleration of p is
proximation is computed, and h is the size of the time in¡
¢
crement between samples. Finite difference operators are
ẍp = ẍb + ω̇ × xp/b + ω × ω × xp/b
£
¤
linear combinations of function evaluations in the neigh= ẍb + C(ω̇) + C(ω)2 xp/b ,
(25) borhood of the evaluation point. A general finite difference
approximation is written
or, using a combination of world and body-fixed terms:
1 X
³
´i
h
∆nS,h z (t0 ) = n
ak z (t0 + kh)
0
0
0
0
0
T
h
ẍp = ẍb + R ω̇ × xp/b + ω × ω × xp/b
k∈S
£
¤
1 X
= ẍb + RT C(ω̇0 ) + C(ω0 )2 x0p/b ,
(26)
=
bk z (t0 + kh) ,
(31)
c hn
k∈S
where
where {ak ∈ Q|k ∈ S} is the set finite difference coefficients


−ω3 2 − ω2 2
ω2 ω1
ω3 ω1
for which c ∈ Z and {bk ∈ Z|k ∈ S} are a convenient ratio . (27) nal decomposition. The actual derivative of the function
ω2 ω1
−ω3 2 − ω1 2
ω3 ω2
C(ω)2 = 
ω3 ω1
ω3 ω2
−ω2 2 − ω1 2
is
3.3
z(n) (t0 ) = ∆nS,h z (t0 ) + d hm z(n+m) (η) ,
Motion of a Particle in a Moving Frame
(32)
where m is called the order of accuracy, and η ∈ [t0 −h, t0 +
Next, we consider the case in which the point is not rigidly h] is some unknown evaluation point for the truncation
attached to the body, but is a particle moving relative to error term.
it. The velocity of the particle in the world frame is
The error is not typically calculated, but m indicates
how the error depends on the step size, h. For examẋp = ẋb + ẋp/b + ω × xp/b
ple, halving the step size produces a fourfold improvement
³
´
0
0
0
T
in accuracy for second-order accurate methods but only a
= ẋb + R ẋp/b + ω × xp/b
twofold improvement for first-order accurate methods.
³
´
0
0
0
T
Tables 1 and 2 show the finite difference coefficients for
(28)
= ẋb + R ẋp/b + C(ω ) xp/b ,
various stencils and orders.
and the acceleration is
angular
5
centripetal
z }| { z
¡ }|
¢{
ẍp = ẍb + ω̇ × xp/b + ω × ω × xp/b
+ ẍp/b + 2ω × ẋp/b .
| {z }
5.1
(29)
Euler Angles
Rotation Sequence
Three coordinate rotations in sequence can describe any
rotation. Let us consider triple rotations in which the first
Coriolis
7
Table 1: Finite difference coefficients over a
seven-point stencil.
k
m
c
-3 -2 -1
0
1 2 3
First Derivative (bk )
1
1
-1
1
1
1
-1
1
2
2
1 -4
3
2
-1
0
1
2
2
2
-3
4 -1
3
6
-2 9 -18
11
3
6
1 -6
3
2
3
6
-2
-3
6 -1
6
-11
18 -9 2
3
4
12 -1 6 -18
10
3
4
12
1 -8
0
8 -1
4
12
-3
-10
18 -6 1
5
60 -2 15 -60
20
30 -3
5
60
3 -30 -20
60 -15 2
6
60 -1 9 -45
0
45 -9 1
Second Derivative (bk )
1
1
1 -2
1
1
1
1
-2 1
2
1
-1 4 -5
2
2
1
1
-2
1
2
1
2
-5 4 -1
3
12 -1 4 6
-20
11
12
11
-20
6 4 -1
3
4
12
-1 16
-30
16 -1
6 180 2 -27 270 -490 270 -27 2
Third Derivative (bk )
1
1
-1 3 -3
1
1
1
-1 3
-3
1
1
1
-1
3
-3 1
1
1
-1
3 -3 1
2
2
1 -6 12
-10
3
2
2
-1 2
0
-2 1
2
2
-3
10
-12 6 -1
3
4
1 -7 14
-10
1 1
3
4
-1 -1
10
-14 7 -1
4
8
1 -8 13
0
-13 8 -1
Fourth Derivative (bk )
1
1
1 -4 6
-4
1
1
1
-4
6 -4 1
1
2
1
1 -4
6
-4 1
4
6
-1 12 -39
56
-39 12 -1
Fifth Derivative (bk )
1
1
-1 5 -10
10
-5 1
1
-1 5
-10
10 -5 1
1
2
2
-1 4 -5
0
5 -4 1
Sixth Derivative (bk )
2
1
1 -6 15
-20
15 -6 1
symmetric
d
1/2
-1/2
1/3
-1/6
1/3
1/4
-1/12
1/12
-1/4
-1/20
1/30
-1/20
1/60
-1/60
-1/140
Table 2: Finite difference coefficients over a one-sided
seven-point stencil.
k
m
c
0
1
2
3
4
5 6
d
First Derivative (bk )
1
1
-1 1
-1/2
2
2
-3 4 -1
1/3
3
6
-11 18 -9 2
-1/4
1/5
4 12 -25 48 -36 16 -3
5 60 -137 300 -300 200 -75 12
-1/6
6 60 -147 360 -450 400 -225 72 -10
1/7
Second Derivative (bk )
2
1
2 -5 4 -1
11/12
3 12
35 -104 114 -56 11
-5/6
4 12
45 -154 214 -156 61 -10
137/180
Third Derivative (bk )
1
1
-1 3 -3 1
-3/2
2
2
-5 18 -24 14 -3
7/4
4
-17 71 -118 98 -41 7
-15/8
3
4
8
-49 232 -461 496 -307 104 -15
29/15
Fourth Derivative (bk )
1
1
1 -4 6 -4 1
-2
2
1
3 -14 26 -24 11 -2
17/6
3
6
35 -186 411 -484 321 -114 17
-7/2
Fifth Derivative (bk )
1
1
-1 5 -10 10 -5 1
-5/2
2
2
-7 40 -95 120 -85 32 -5
25/6
Sixth Derivative (bk )
1
1
1 -6 15 -20 15 -6 1
-3
1
-1
11/12
-1/12
11/12
-1/12
1/12
1/90
-1/560
3/2
1/2
-1/2
-3/2
1/4
-1/4
1/4
-1/8
1/8
7/120
1
-1
-1/6
7/240
1/2
-1/2
-1/3
-1/4
8
rotation is an angle ψ about the k-axis, the second rotation
is an angle θ about the j-axis, and the third rotation is an
angle φ about the i-axis. For notational brevity, let us
arrange these angles in a three-dimensional vector called
the Euler angle vector, defined by
14
Relative Error [%]
T
u := [φ, θ, ψ] .
16
(33)
The function that maps an Euler angle vector to its
corresponding rotation matrix, Rijk : R3 → SO(3), is
Rijk (φ, θ, ψ) := Ri (φ)Rj (θ)Rk (ψ).
z = Rijk (u)T z0 .
(36)
8
6
0
0
5
10
15
20
Angle, α [degrees]
25
30
Figure 2: Error in the linearized approximations to the
sine and cosine as a function of the input angle.
5.3
5.2
10
2
As in the general case, if z ∈ R3 is a vector in the world
coordinates and z0 ∈ R3 is the same vector expressed in the
body-fixed coordinates, then the following relations hold:
(35)
12
4
(34)
z0 = Rijk (u) z
(α − sin(α))/sin(α)
(1 − cos(α))/cos(α)
Linearization
Euler Angle Rates and Angular Veloc- Many applications require linear equations. Functions of
ity
Euler angles depend on trigonometric primitives such as
the sine and cosine. As a consequence, it is useful to consider the linearized versions of these functions.
We consider the case of linearizing about zero. In this
context, linearization involves substituting:
The time-derivative of the Euler angle vector is the vector
of Euler angle rates. The relationship between the Euler
angle rates and the angular velocity of the body is encoded
in the Euler angle rates matrix. Multiplying this matrix
by the vector of Euler angle rates gives the angular velocity in the global coordinates. Letting êi be the ith unit
vector, the function that maps an Euler angle vector to its
corresponding Euler angle rates matrix, E : R3 → R3x3 , is
£
¤
Eijk (φ, θ, ψ) := Rk (ψ)T Rj (θ)T êi , Rk (ψ)T êj , êk , (37)
cos(α) → 1
sin(α) → α.
(45)
(46)
Higher order terms are then set to zero. These substitutions are valid for small values of α. Fig. 2 shows the
relative error in these approximations as a function of the
input angle. A relative error of 1% is reached in the apand the related conjugate Euler angle rates matrix func- proximation to the sine at an angle of 14◦ ; for the cosine,
tion, E 0 : R3 → R3x3 , whose multiplication with the vector the same error is reached at an angle of 8.2◦ . Typically,
of Euler angle rates yields the body-fixed angular velocity these approximations are considered valid for angles less
is
than 10◦ .
We denote the linearization operation by L. For ex0
Eijk
(φ, θ, ψ) := [êi , Ri (φ)êj , Ri (φ)Rj (θ)êk ] .
(38) ample, the linearized version of the function Rijk (u) is
L{Rijk (u)}. In Sec. 8 we include the linearized versions
Hence,
of several key functions in the exposition of each valid rotation sequence.
ω = Eijk (u) u̇
(39)
Linearizing about an attitude other than zero is most
0
ω0 = Eijk
(u) u̇.
(40) easily accomplished by considering small perturbations about
a fixed attitude. Let u0 be the set of Euler angles about
Noting also that the angular velocity in the body-fixed which we would like to linearize and let u be the vector of
coordinates may be related to the angular velocity in the perturbation angles. We write
global coordinates by
Ru0 (u) = L {Rijk (u)} Rijk (u0 ).
(47)
ω0 = Rijk (u) ω
T
(41)
0
ω = Rijk (u) ω ,
Here, we are considering u0 to be constant, such that the
product of the two rotation matrices is still linear in the
parameters of u.
(42)
we may eliminate ω, ω0 , and u̇ to yield
−1
0
Rijk (u) = Eijk
(u) [Eijk (u)]
£ 0
¤−1
T
(u)
Rijk (u) = Eijk (u) Eijk
.
5.4
(43)
Valid Rotation Sequences
Thus far, we have not specified what sequences of coordinate rotations are able to span the space of all three di-
(44)
9

Table 3: Corresponding quantities between the three most
common Euler angle conventions.
1
L{R313 (φ, θ, ψ)} =  −φ − ψ
0
Rotation Sequence
(1,2,3)
(3,1,3)
(3,2,3)
ψ
−ψ
−ψ
π
π
θ
2 −θ
2 −θ
φ
φ
φ
x
−y
x
y
−x
−y
z
−z
z
x0
z0
z0
y0
−x0
−y 0
0
0
z
−y
x0

0
θ .
1
(50)
The derivatives of the rotation matrix with respect to the
Euler angles are
∂R313
=
∂φ

−sφ cψ − cφ cθ sψ
 −cφ cψ + sφ cθ sψ
0
mensional rotations. In fact, of the 27 possible sequences
of three integers in {1, 2, 3}, there are only 12 that satisfy
the constraint that no two consecutive numbers in a valid
sequence may be equal. These are
©
(i, j, k) ∈ (1, 2, 1) , (1, 2, 3), (1, 3, 1) , (1, 3, 2) ,
(2, 1, 2) , (2, 1, 3) , (2, 3, 1) , (2, 3, 2) ,
ª
(3, 1, 2) , (3, 1, 3), (3, 2, 1) , (3, 2, 3) .
ψ+φ
1
−θ
(48)

sφ sθ sψ
∂R313
=  cφ sθ sψ
∂θ
cθ sψ
∂R313
=
∂ψ

−cφ sψ − sφ cθ cψ
 sφ sψ − cφ cθ cψ
sθ cψ

cφ sθ
−sφ sθ 
0
(51)

sφ cθ
cφ cθ 
−sθ
(52)

0
0 .
0
(53)
−sφ sψ + cφ cθ cψ
−cφ sψ − sφ cθ cψ
0
−sφ sθ cψ
−cφ sθ cψ
−cθ cψ
cφ cψ − sφ cθ sψ
−sφ cψ − cφ cθ sψ
sθ sψ
The three in bold, (1, 2, 3), (3, 1, 3), and (3, 2, 3), are the
most common choices. These three conventions are con- 5.5.3 Euler Angles ⇐ Rotation Matrix
trasted in Table 3 and the first two are discussed presently. The inverse mapping, which gives the Euler angles as a
function of the rotation matrix, and the composition of
5.5 Euler Angle Sequence (3,1,3)
that function with the rotation matrix as a function of the
unit quaternion,
 are
 

5.5.1 Usage
φ313 (R)
atan2 (r13 , r23 )

u313 (R) =  θ313 (R)  =  acos (r33 )
(54)
The most common sequence associated with the name Euψ
(R)
atan2
(r
,
−r
)
313
31
32
ler angles is (3, 1, 3), named for Leonhard Euler, an 18thcentury Swiss mathematician and physicist. To disam

¡
biguate it from the other conventions that share the same
atan2 2q1 q3 − 2q0 q2 ,¢
name, it is also known as the x-convention.


2 q3 + 2q0 q1

¡ 2q
¢
In the study of the gyroscopic motion of a spinning rigid
2
2
2
2 
u313 (Rq (q)) = 
acos
q
−
q
−
q
+
q
(55)
2
1
0


¡3
body, the Euler angles, φ, θ, and ψ, are known respectively
 atan2 2q1 q3 + 2q0 q2 ,

¢
as spin, nutation, and precession.
−2q2 q3 + 2q0 q1
A commonplace example of gyroscopic motion is a spinning top. In this case, the body-fixed z-axis is aligned
with the spin-axis of the top, and the body-fixed x- and 5.5.4 Euler Angles ⇒ Euler Angle Rates Matrices
y-axes point out the sides of the top. The tilt of the top
away from the world z-axis is the nutation angle, and the The Euler angle rates matrices as a function of the Euler
moment arising from this tilt produces the familiar slow angles, their linearized equivalents, and their inverses, are
orbiting motion, called precession.


sθ sψ cψ 0
E313 (φ, θ, ψ) =  −sθ cψ sψ 0 
(56)
5.5.2 Euler Angles ⇒ Rotation Matrix
cθ
0 1
For compact notation in this and subsequent sections, we


write cθ := cos(θ), sφ := sin(φ), etc. The function that
0 1 0
maps a vector of Euler angles to its rotation matrix, and
L{E313 (φ, θ, ψ)} =  −θ ψ 0 
(57)
that same function linearized, are
1 0 1
R313 (φ, θ, ψ) = R3 (φ)R1 (θ)R3 (ψ) =




sψ
−cψ 0
cφ cψ − sφ cθ sψ
cφ sψ + sφ cθ cψ sφ sθ
1 
−1
 −sφ cψ − cφ cθ sψ −sφ sψ + cφ cθ cψ cφ sθ 
sθ cψ sθ sψ 0 
[E313 (φ, θ, ψ)] =
(58)
(49)
s
θ
−s c c c s
s s
−s c
c
θ ψ
θ ψ
ψ θ
θ
10
ψ θ
θ
5.5.6
z, z′′′
z′′, z′
θ
y′
y′′
φ
θ
y′′′
ψ
φ
ψ
Singularities
This parametrization has singularities at nutation values
of θ = nπ for n ∈ Z. At these points, changes in spin and
precession constitute the same motion. This can be most
readily seen in Eq. 56, in which the leading coefficient is
1/ sin(θ).
It is a notable characteristic of this parametrization,
and all parameterizations of the form (i, j, i), that there exists a singularity at the home position, [φ, θ, ψ] = [0, 0, 0].
This and other singularities are discussed further in Sec.
5.8.
x′
x
y
5.6
Euler Angle Sequence (1,2,3)
x′′′, x′′
5.6.1
Figure 3: Euler Angle Sequence (3,1,3)

0
0
E313
(φ, θ, ψ) =  0
1
cφ
−sφ
0


sφ sθ
cφ sθ 
cθ

1 0
−φ θ 
0 1
0
0
L{E313
(φ, θ, ψ)} =  0
1

−sφ cθ −cφ cθ
1 
−1
0
cφ sθ −sφ sθ
[E313
(φ, θ, ψ)] =
sθ
sφ
cφ
The derivatives of the Euler angle
spect to the Euler angles are

cθ sψ
∂E313
=  −cθ cψ
∂θ
−s

sθ
0 .
0
(60)
(61)
rates matrices with re-

0
0 
0
θ


sθ cψ −sψ 0
∂E313
=  sθ sψ cψ 0 
∂ψ
0
0
0


0 −sφ cφ sθ
0
∂E313
=  0 −cφ −sφ sθ 
∂φ
0
0
0


0 0 sφ cθ
0
∂E313
=  0 0 cφ cθ  .
∂θ
0 0 −sθ
5.5.5
(59)
0
0
0
(62)
(63)
(64)
(65)
Usage
The angles associated with the sequence (1, 2, 3) are sometimes called Cardan angles, for Gerolamo Cardano, an
Italian Renaissance mathematician; Tait-Bryan angles, for
Peter Guthrie Tait, a 19th-century Scottish mathematical
physicist; or nautical angles. They are commonly used in
aerospace engineering and computer graphics.
Despite the lack of consensus on the issue, these angles are also commonly referred to simply as Euler angles
in the aeronautics field, in which φ, θ, and ψ are known
respectively as roll, pitch, and yaw, or, equivalently, bank,
attitude, and heading.
Respecting the common and technical usage of these
terms, these angles describe a vehicle whose forward direction is along the positive body-fixed x-axis, with the
body-fixed y-axis to starboard, and the body-fixed z-axis
downward. In such a configuration, the home position,
[φ, θ, ψ] = [0, 0, 0], is flat and level, pointing forward
along the world x-axis.
The non-intuitive downward-pointing z-axis is chosen
in order to make a positive change in θ correspond to pitching upward. A less common standard using the same sequence is to have the y-axis point to port and the z-axis
point upward. In this case, a positive change in θ corresponds to pitching downward.
5.6.2
Euler Angles ⇒ Rotation Matrix
The function that maps a vector of Euler angles to its
rotation matrix, and that same function linearized, are
R123 (φ, θ, ψ) = R1 (φ)R2 (θ)R3 (ψ) =


cθ cψ
cθ sψ
−sθ
 sφ sθ cψ − cφ sψ sφ sθ sψ + cφ cψ cθ sφ 
cφ sθ cψ + sφ sψ cφ sθ sψ − sφ cψ cθ cφ
Euler Angles ⇒ Unit Quaternion
The function that maps Euler angles to their corresponding
unit quaternion is


cφ/2 cθ/2 cψ/2 − sφ/2 cθ/2 sψ/2
 cφ/2 cψ/2 sθ/2 + sφ/2 sθ/2 sψ/2 

q313 (φ, θ, ψ) = 
 cφ/2 sθ/2 sψ/2 − sφ/2 cψ/2 sθ/2  . (66)
cφ/2 cθ/2 sψ/2 + cθ/2 cψ/2 sφ/2

1
L{R123 (φ, θ, ψ)} =  −ψ
θ
11

ψ −θ
1
φ .
−φ 1
(67)
(68)
z, z′′′
5.6.4
θ
The Euler angle rates matrices as a function of the Euler
angles, their linearized equivalents, and their inverses, are


cθ cψ −sψ 0
E123 (φ, θ, ψ) =  cθ sψ cψ 0 
(74)
−sθ
0
1
z′′
z′
φ

y′
1
L{E123 (φ, θ, ψ)} =  ψ
−θ
φ
y′′′, y′′
ψ
Euler Angles ⇒ Euler Angle Rates Matrices
ψ
x
x′′′
y
−1
θ
[E123 (φ, θ, ψ)]

cψ
1 
−cθ sψ
=
cθ
cψ sθ

1
0
E123
(φ, θ, ψ) =  0
0
x′′, x′
Figure 4: Euler Angle Sequence (1,2,3)
sψ
cθ cψ
sψ sθ
0
cφ
−sφ

1 0
0
L{E123
(φ, θ, ψ)} =  0 1
0 −φ
The derivatives of the rotation matrix with respect to the
Euler angles are
∂R123
=
∂φ

0
 cφ sθ cψ + sφ sψ
−sφ sθ cψ + cφ sψ
0
cφ sθ sψ − sφ cψ
−sφ sθ sψ − cφ cψ

∂R123
∂θ
−cψ sθ
=  sφ cθ cψ
cφ cθ cψ
−sψ sθ
sφ cθ sψ
cφ cθ sψ

0
cφ cθ 
−sφ cθ

−cθ
−sφ sθ 
−cφ sθ
−1
0
[E123
(φ, θ, ψ)]
(69)
(70)

c
1  θ
0
=
cθ
0
sφ sθ
cφ cθ
sφ
The derivatives of the Euler angle
spect to the Euler angles are

−cψ sθ
∂E123
=  −sψ sθ
∂θ
−c
θ
∂R123
=
∂ψ

−cθ sψ
 −sφ sθ sψ − cφ cψ
−cφ sθ sψ + sφ cψ
5.6.3
cθ cψ
sφ sθ cψ − cφ sψ
cφ sθ cψ + sφ sψ

0
0 .
0

−cθ sψ
∂E123
=  cθ cψ
∂ψ
0
(71)

0
0
0
∂E123
=  0 −sφ
∂φ
0 −cφ
Euler Angles ⇐ Rotation Matrix

0
0 
1
−ψ
1
0

0
0 
cθ

−sθ
cθ sφ 
cθ cφ
(75)
(76)
(77)

−θ
φ 
1
(78)

cφ sθ
−sφ cθ  .
cφ
(79)
rates matrices with re
0 0
0 0 
0 0
(80)

0
0 
0
(81)

0
cφ cθ 
−sφ cθ
(82)
−cψ
−sψ
0
The inverse mapping, which gives the Euler angles as a


function of the rotation matrix, and the composition of
0 0
−cθ
0
∂E123
that function with the rotation matrix as a function of the
=  0 0 −sφ sθ  .
(83)
unit quaternion, are
∂θ
0 0 −cφ sθ

 

φ123 (R)
atan2 (r23 , r33 )

u123 (R) =  θ123 (R)  =  −asin (r13 )
(72) 5.6.5 Euler Angles ⇒ Unit Quaternion
ψ123 (R)
atan2 (r12 , r11 )
The function that maps Euler angles to their corresponding
unit quaternion is

¡

atan2 2q2 q3 + 2q0 q1 ,


¢
2
2
2
2 

cφ/2 cθ/2 cψ/2 + sφ/2 sθ/2 sψ/2

¡q3 − q2 − q1¢ + q0 
 −cφ/2 sθ/2 sψ/2 + cθ/2 cψ/2 sφ/2 
 (73)
u123 (Rq (q)) = 

 −asin¡ 2q1 q3 − 2q0 q2

q123 (φ, θ, ψ) = 
 cφ/2 cψ/2 sθ/2 + sφ/2 cθ/2 sψ/2  . (84)
 atan2 2q1 q2 + 2q0 q3 ,

¢
cφ/2 cθ/2 sψ/2 − sφ/2 cψ/2 sθ/2
q1 2 + q0 2 − q3 2 − q2 2
12
5.6.6
Singularities
A common strategy for dealing with this problem is to
change representations whenever an object nears a singuThis parametrization has singularities at pitch values of
larity. Even more popular is the use of unit quaternions to
θ = π2 + nπ, for n ∈ Z. It is thus only suitable for derepresent an object’s attitude. Using unit quaternions to
scribing vehicles that do not perform vertical or inverted
represent the attitude of an object completely avoids the
maneuvers, such as land vehicles, boats and ships, and
problem of gimbal lock. Unit quaternions also have several
transport aircraft.
other notable advantages that will be discussed in Sec. 6.
All Euler angle sequences that do not have a repeated
The main disadvantage of unit quaternions, however, is
axis of rotation have this singularity. See Sec. 5.8 for
that they are constrained to have unit length, a constraint,
further details on this and other singularities.
that while inconsequential in many cases, can lead to complications when attempting to optimize over the quater5.7 Derivatives of Selected Trigonometric nion parameters. This is due to the fact that a unity norm
constraint is quadratic in form and thus impossible to inFunctions
clude in most standard optimization techniques.
Throughout this report we use various trigonometric functions. The derivatives of most of these will be familiar to
the reader, but three of them warrant mention. The four- 5.9 Intra-Euler-Angle Conversion
quadrant inverse tangent, atan2 : R × R → [−π, π], and its
Converting between representations is sometimes necessary
derivatives are
to avoid gimbal lock. In this section, the conversions be
tween (3, 1, 3) sequence and the (1, 2, 3) sequence are proif x > 0
 atan(y/x)
atan2(y, x) = atan(y/x) − π if x < 0 ∧ y < 0 (85) vided, along with Jacobians required for filtering applica atan(y/x) + π if x < 0 ∧ y > 0
tions.
∂atan2(y, x)
−y
= 2
∂x
x + y2
x
∂atan2(y, x)
= 2
.
∂y
x + y2
5.9.1
(86)
A set of (3, 1, 3) Euler angles may be written as a function
of a set of (1, 2, 3) Euler angles according to
(87)
u123
313 (φ, θ, ψ) = u313 (R123 (φ, θ, ψ))


atan2 (−sθ , sφ cθ )
 (90)
acos (cφ cθ )
=
atan2 (cφ sθ cψ + sφ sψ , −cφ sθ sψ + sφ cψ )
The derivatives of the inverse sine and inverse cosine are
dasin(x)
1
=√
dx
1 − x2
dacos(x)
−1
.
=√
dx
1 − x2
5.8
Sequence (3,1,3) ⇐ Sequence (1,2,3)
(88)
The Jacobian of this function with respect to the (1, 2, 3)
Euler angles is
(89)
h 123
i
∂u123
∂u123
∂u123
313
313
313
313
= ∂u∂φ
∂θ
∂ψ
∂u


c s c
−s
0
1  √φ θ θ √ φ
asφ cθ
acφ sθ 0 
=
a
−sθ
sφ cφ cθ a
Singularities
The singularities found in the various Euler angle representations are said to arise from gimbal lock. Two examples
of this phenomenon are presented in Sec’s. 5.5.6 and 5.6.6.
Gimbal lock may be understood in several different
ways. Intuitively, it arises from the indistinguishability of
changes in the first and third Euler angles when the second
Euler angle is at some critical value. Take, for example,
the (1, 2, 3) sequence. When the pitch angle is 90 degrees,
the vehicle is pointing straight up, and roll and yaw are indistinguishable. In the case of the (3, 1, 3) sequence, when
the nutation angle is zero, changes in the spin angle are
the same as changes in the precession angle.
The phenomenon may also be seen in the mathematics,
where it manifests itself as singularities. Again, consider
the (1, 2, 3) sequence. In this case, when cos(θ) = 0, then
r23 = r33 = r12 = r11 = 0, and the expressions for φ123 (R)
and ψ123 (R) in Eq. 73 are undefined. A similar consequence may be observed in the case of the (3, 1, 3) sequence
when sin(θ) = 0. This effect is even more obvious in Eqs.
56 and 74, where the singularity may be seen directly in
the leading coefficient.
(91)
where
a := 1 − c2φ c2θ
(92)
is a repeating term that has been factored for notational
and computational ease.
5.9.2
Sequence (1,2,3) ⇐ Sequence (3,1,3)
A set of (1, 2, 3) Euler angles may be written as a function
of a set of (3, 1, 3) Euler angles according to
13
u313
123 (φ, θ, ψ) = u123 (R313 (φ, θ, ψ))


atan2 (cφ sθ , cθ )

−asin (sφ sθ )
=
atan2 (cφ sψ + sφ cθ cψ , cφ cψ − sφ cθ sψ )
(93)
The Jacobian of this function with respect to
Euler angles is
h 313
i
∂u313
∂u313
∂u313
123
123
123
123
= ∂u∂φ
∂θ
∂ψ
∂u
¡ 2
¢

1
1
2
− a sφ sθ cθ
a cφ cθ + sθ

− √1b cφ sθ
− √1b sφ cθ
=
³
´
1
2
2
− 1c cφ sφ sθ
c cθ sφ + cφ
the (3, 1, 3)

0
0 

1
where the skew-symmetric cross product matrix function
C : R3 → R3×3 is defined by


0
−x3 x2
0
−x1  .
C(x) =  x3
(105)
−x2 x1
0
(94)
6.3
More compactly, quaternion multiplication may be written
as the second quaternion pre-multiplied by a matrix-valued
function of the first quaternion. That is,
where
a := c2θ + c2φ s2θ
b := 1 − s2φ s2θ
c :=
s2φ c2θ
+
(95)
c2φ
(96)
q · p = qm (q, p) = Q(q)p = Q̄(p)q
(106)
p · q = qm (p, q) = Q(p)q = Q̄(q)p,
(107)
where the quaternion matrix function, Q : H → R4×4 is
defined by
·
¸
q0
−qT1:3
(108)
Q(q) =
q1:3 q0 I3 + C(q1:3 )


q0 −q1 −q2 −q3
q0
q3 −q2 
 q
= 1
,
(109)
q2 −q3 q0
q1 
q3 q2 −q1 q0
are repeating terms that have been factored for notational
and computational ease.
6
Quaternion ⇒ Quaternion Matrices
Quaternions
Quaternions were first devised by William Rowan Hamilton, a 19th-century Irish mathematician. There is a substantial body of quaternion mathematics that are beyond
the scope of this report. Consequently, we focus on the and the the closely related conjugate quaternion matrix
essential definitions required to use the quaternion as a function, Q̄ : H → R4×4 is defined by
representation of the attitude of an object.
¸
·
q0
−qT1:3
(110)
Q̄(q) =
q1:3 q0 I3 − C(q1:3 )
6.1 General Quaternions


q0 −q1 −q2 −q3
A quaternion, q ∈ H, may be represented as a vector,
q0 −q3 q2 
 q
= 1
.
(111)
·
¸
q
q3
q0 −q1 
2
q0
T
q = [q0 , q1 , q2 , q3 ] =
,
(97)
q3 −q2 q1
q0
q1:3
along with a set of additional definitions and operations Substituting Eq. 98 into Eqs. 108 and 110 yields
that may be applied to it. The adjoint, norm, and inverse
Q(q̄) = Q(q)T
(112)
of the quaternion, q, are
T
·
¸
Q̄(q̄) = Q̄(q) .
(113)
q0
q̄ =
(98)
−q1:3
The derivatives of the quaternion multiplication function
q
are
(99)
kqk = q02 + q12 + q22 + q32
∂qm (q, p)
q̄
= Q̄(p)
(114)
q−1 =
.
(100)
∂q
kqk
∂qm (q, p)
= Q(q).
(115)
∂p
6.2 Quaternion Multiplication
The derivatives of the quaternion matrix functions with
respect to the parameters of the quaternion are




1 0 0 0
0 −1 0 0
∂Q
 0 1 0 0  ∂Q
 1 0 0 0 
=
,
=
, (116)
0 0 1 0  ∂q1
0 0 0 1 
∂q0
0 0 0 1
0 0 −1 0




0 0 −1 0
0 0 0 −1
∂Q
0 0 0 −1  ∂Q
0 0 1 0 
=
,
=
. (117)
1 0 0 0  ∂q3
0 −1 0 0 
∂q2
0 1 0 0
1 0 0 0
Quaternion multiplication is not commutative. Quaternion
multiplication between quaternions q and p is defined by
q · p = qm (q, p)
·
¸
q0 p0 − qT1:3 p1:3
=
q0 p1:3 + p0 q1:3 − q1:3 × p1:3
·
¸·
¸
p0
q0
−qT1:3
=
p1:3
q1:3 q0 I3 − C(q1:3 )
·
¸
·
¸
q0
p0
−pT1:3
=
,
q1:3
p1:3 p0 I3 + C(p1:3 )
(101)
(102)
(103)
(104)
14

1 0 0 0
∂ Q̄
 0 1 0 0
=
0 0 1 0
∂q0
0 0 0 1

0 0 −1
∂ Q̄
0 0 0
=
1 0 0
∂q2
0 −1 0
6.4



0 −1 0 0
 ∂ Q̄
1 0 0 0 
=
,
(118)
,
0 0 0 −1 
∂q1
0 0 1 0



0
0 0 0 −1
1  ∂ Q̄
 0 0 −1 0 
,
=
. (119)
0  ∂q3
0 1 0 0 
0
1 0 0 0
6.5
Unit Quaternion ⇐ Rotation Matrix
The reverse mapping, from a rotation matrix to a quaternion, is slightly more complicated. Inspection of Eq. 125
yields the following relations:
Unit Quaternion ⇒ Rotation Matrix
4q02 = 1 + rq11 (q) + rq22 (q) + rq33 (q)
(131)
4q12
4q22
4q32
= 1 + rq11 (q) − rq22 (q) − rq33 (q)
(132)
= 1 − rq11 (q) + rq22 (q) − rq33 (q)
(133)
= 1 − rq11 (q) − rq22 (q) + rq33 (q)
(134)
Unit quaternions are quaternions with unity norm. Throughout this section, we assume that
kqk = 1.
(120)
A unit quaternion can be used to represent the attitude
of a rigid body. Consider a vector z ∈ R3 in the global
coordinates. If z0 ∈ R3 is the same vector in the bodyfixed coordinates, then the following relations hold:
·
¸
·
¸
0
0
=
q
·
· q−1
(121)
z0
z
·
¸
0
=q·
· q̄
(122)
z
·
¸
0
= Q̄(q)T Q(q)
(123)
z
¸
¸
·
·
0
1
0T
,
(124)
=
z
0 Rq (q)

1
(1 + r11 + r22 + r33 ) 2
1
1 (r23 − r32 )/(1 + r11 + r22 + r33 ) 2 

q0R (R) = 
1
2 (r31 − r13 )/(1 + r11 + r22 + r33 ) 2 
(r12 − r21 )/(1 + r11 + r22 + r33 )
That is,
(126)
T 0
z = Rq (q) z .
(127)
The derivatives of the rotation matrix
spect to the quaternion parameters are



q0 q3 −q2
q1
∂Rq
∂Rq
= 2−q3 q0 q1 ,
= 2q2
∂q0
∂q1
q2 −q1 q0
q3



−q2 q1 −q0
−q3
∂Rq
∂Rq
= 2 q1 q2 q3 ,
= 2−q0
∂q2
∂q3
q q −q
q
3
2
1
(141)
1
2

1
(r23 − r32 )/(1 + r11 − r22 − r33 ) 2
1

1
(1 + r11 − r22 − r33 ) 2

q1R (R) = 
1

2
2 (r12 + r21 )/(1 + r11 − r22 − r33 ) 
1
(r31 + r13 )/(1 + r11 − r22 − r33 ) 2
(142)

1
(r31 − r13 )/(1 − r11 + r22 − r33 ) 2
1
1 (r12 + r21 )/(1 − r11 + r22 − r33 ) 2 

q2R (R) = 
1

2
(1 − r11 + r22 − r33 ) 2
1
(r23 + r32 )/(1 − r11 + r22 − r33 ) 2
(143)

1
(r12 − r21 )/(1 − r11 − r22 + r33 ) 2
1
1 (r31 + r13 )/(1 − r11 − r22 + r33 ) 2 
 . (144)
q3R (R) = 
1
2 (r23 + r32 )/(1 − r11 − r22 + r33 ) 2 
1
(1 − r11 − r22 + r33 ) 2
Just as with rotation matrices, sequences of rotations are
represented by products of quaternions. That is, for unit
quaternions q and p, it hods that
Rq (q · p) = Rq (q)Rq (p).
(135)
(136)
(137)
(138)
(139)
(140)

Rq (q) =
(125)

 2
2
2
2
2q1 q3 − 2q0 q2
q0 + q1 − q2 − q3 2q1 q2 + 2q0 q3
 2q1 q2 − 2q0 q3 q02 − q12 + q22 − q32 2q2 q3 + 2q0 q1  .
2q1 q3 + 2q0 q2
2q2 q3 − 2q0 q1 q02 − q12 − q22 + q32
z0 = Rq (q)z
= rq23 (q) + rq32 (q)
= rq31 (q) + rq13 (q)
= rq12 (q) + rq21 (q)
= rq23 (q) − rq32 (q)
= rq31 (q) − rq13 (q)
= rq12 (q) − rq21 (q).
From these we arrive at four different inverse mappings.
These are qiR : SO(3) → H for i ∈ {0, 1, 2, 3}, defined by
where
0
4q2 q3
4q1 q3
4q1 q2
4q0 q1
4q0 q2
4q0 q3
(128)
Depending on the values of R, some of these functions
will produce complex results. To avoid such an event, we
define the following composite function, which selects the
best of these four, depending on the parameters of R. The
function, qR : SO(3) → H, is
function with re
q2 q3
−q1 q0 , (129)
−q0 −q1

q0 q1
−q3 q2  . (130)
q2 q3
qR (R) :=
 0
q (R) if

 R
q1R (R) if
q2R (R) if

q3R (R) if
15
r22
r22
r22
r22
> −r33 ,
< −r33 ,
> r33 ,
< r33 ,
r11
r11
r11
r11
> −r22 ,
> r22 ,
< r22 ,
< −r22 ,
r11
r11
r11
r11
> −r33
> r33
< −r33
< r33 .
(145)
6.6
Quaternion Rates ⇒ Angular Velocity More compactly:
The time derivative of the unit quaternion is the vector of
1
q̇ω (q, ω) = W (q)T ω
(158)
quaternion rates. The quaternion rates, q̇, are related to
2
the angular velocity. The functions that map a unit quater1
(159)
q̇ω0 (q, ω0 ) = W 0 (q)T ω0 .
nion and its temporal derivative to the angular velocity in
2
4
3
world and body-fixed coordinates are ωq : H × R → R
and ω0q : H × R4 → R3 , defined by
6.8 Quaternion Rates ⇒ Angular Acceler·
¸
ation
0
= 2q̄ · q̇ = 2Q(q)T q̇
(146)
ωq (q, q̇)
The angular acceleration, expressed in the global and body·
¸
fixed coordinates may also be related to time derivatives
0
(147) of the quaternion parameters by
= 2q̇ · q̄ = 2Q̄(q)T q̇.
ω0q (q, q̇)
·
¸
·
¸
0
kq̇k2
More compactly:
= 2q̄ · q̈ + 2
(160)
ω̇
0
·
¸
ωq (q, q̇) := 2W (q)q̇
(148)
kq̇k2
T
=
2Q(q)
q̈
+
2
(161)
0
ω0q (q, q̇) := 2W 0 (q)q̇,
(149)
where the quaternion rates matrices, W : H → R3×4 and
W 0 : H → R3×4 , are defined by


−q1 q0 −q3 q2
q0 −q1 
W (q) := −q2 q3
(150)
−q3 −q2 q1
q0


−q1 q0
q3 −q2
q1  .
W 0 (q) := −q2 −q3 q0
(151)
−q3 q2 −q1 q0
The derivatives of the quaternion rates matrices with respect to the parameters of the quaternion are




0 1 0 0
−1 0 0 0
∂W
∂W
= 0 0 1 0 ,
=  0 0 0 −1 ,
(152)
∂q0
0 0 0 1 ∂q1
0 0 1 0




0 0 0 1
0 0 −1 0
∂W
∂W
= −1 0 0 0  ,
=  0 1 0 0  , (153)
∂q2
∂q3
0 −1 0 0
−1 0 0 0




0 1 0 0
−1 0 0 0
0
∂W 0
∂W
= 0 0 1 0 ,
=  0 0 0 1 ,
(154)
∂q0
∂q
1
0 0 0 1
0 0 −1 0




0 0 0 −1
0 0 1 0
0
∂W
∂W 0
= −1 0 0 0  ,
=  0 −1 0 0 , (155)
∂q2
∂q3
0 1 0 0
−1 0 0 0
6.7
Quaternion Rates ⇐ Angular Velocity
The inverse mapping, from the angular velocity and the
unit quaternion to the quaternion rates, is closely related.
The functions q̇ω : H × R3 → R4 and q̇ω0 : H × R3 → R4
·
·
¸
¸
1
1
0
0
q̇ω (q, ω) = q ·
= Q(q)
ω
ω
2
2
·
·
¸
¸
1
1
0
0
0
q̇ω0 (q, ω ) =
· q = Q̄(q)
.
ω0
2 ω0
2
·
0
ω̇0
¸
¸
kq̇k2
= 2q̈ · q̄ + 2
0
¸
·
kq̇k2
T
.
= 2Q̄(q) q̈ + 2
0
(162)
(163)
More compactly:
ω̇q (q, q̇) := 2W (q)q̈
ω̇0q (q, q̇) := 2W 0 (q)q̈.
6.9
(164)
(165)
Quaternion Rates ⇐ Angular Acceleration
The inverse mappings, from the angular acceleration rates
to the second derivative of the quaternion, are
1
W (q)T ω̈
2
1
q̈ω0 (q, ω̇0 ) := W 0 (q)T ω̈0 .
2
q̈ω (q, ω̇) :=
6.10
(166)
(167)
Unit Quaternion ⇐ Cayley-Klein Parameters
The Cayley-Klein parameters are closely related to the unit
quaternion. Consequently we will give it only brief mention
here. The Cayley-Klein parameters are α, β, γ, and δ ∈ C.
These parameters are often arranged as a 2 × 2 matrix,
·
¸
α β
K :=
,
(168)
γ δ
and satisfy the constraints
αᾱ + γγ̄ = 1,
(156)
(157)
·
αᾱ + β β̄ = 1,
αβ̄ + γ δ̄ = 0, αδ + βγ = 1,
β = −γ̄, and δ = ᾱ,
where ᾱ is the complex conjugate of α.
16
(169)
(170)
(171)
The function that maps the Cayley-Klein parameters
to their corresponding unit quaternion, qK : C2×2 → H, is
 1

2 (α + δ)
¡£ ¤¢  − i (β + γ) 
2

qK αγ βδ = 
(172)
 1 (β − γ)  .
2
i
− 2 (α − δ)
The corresponding quaternion matrices are given by the
functions Qa : R × S2 → R4×4 and Q̄a : R × S2 → R4×4 ,
where
Qa (α, n) = Q(qa (α, n))

c α2 −n1 s α2 −n2 s α2 −n3 s α2
 n1 s α
c α2
n3 s α2 −n2 s α2
2
=
 n2 s α −n3 s α
c α2
n1 s α2
2
2
n3 s α2 n2 s α2 −n1 s α2
c α2
The function that maps the Cayley-Klein parameters to
their corresponding rotation matrix, Rc : C2×2 → SO(3),
is
¡£ ¤¢
RK αγ βδ =
(173)
1

i
2
2
2
2
2
2
2
2
(γδ−αβ )
2 (α −β −γ +δ ) 2 (−α −β +γ +δ )
 i (α2 −β 2 +γ 2 −δ2 ) 1 (α2 +β 2 +γ 2 +δ2 ) −i (αβ+γδ) .
2
2
(βδ−αγ )
i (αγ+βδ)
(αδ+βγ )
6.11
Q̄a (α, n) = Q̄(qa (α, n))

c α2 −n1 s α2 −n2 s α2 −n3 s α2
 n1 s α
c α2
−n3 s α2 n2 s α2
2
=
 n2 s α n3 s α
c α2
−n1 s α2
2
2
n3 s α2 −n2 s α2 n1 s α2
c α2





.

(179)
(180)
(181)
(182)
The corresponding rotation matrix is given by the function
Ra : R × S2 → SO(3), define by
Unit Quaternion ⇒ Cayley-Klein Parameters
Ra (α, n) = Rq (qa (α, n))
£
¤
= ra1 (α, n) ra2 (α, n) ra3 (α, n) ,
The inverse mapping is Kq : H → C2×2 , defined by
·
¸ ·
¸
αq (q) βq (q)
q0 + iq3 iq1 + q2
Kq (q) =
=
. (174)
γq (q) δq (q)
iq1 − q2 q0 − iq3
Other relationships involving Cayley-Klein parameters,
such as those between the Cayley-Klein parameters and
the Euler angles may be derived from Eq. 172 through
composition with the appropriate functions in Sec. 6 or
Sec. 8.
6.12

Unit Quaternion ⇐ Axis-Angle
Any finite rotation may be achieved by a single rotation
about an appropriately chosen axis. It is therefore possible to parameterize the attitude of a rigid body with an
angle α ∈ R and a unit vector n ∈ S2 , where S2 := {v ∈
R3 | kvk = 1}. The quaternion that arises from a rotation
α about an axis n is given by the axis-angle quaternion
function, qa : R × S2 → H, define by
·
¡ ¢ ¸
cos ¡12 α ¢
qa (α, n) :=
.
(175)
n sin 12 α
the columns of which read
¢
 ¡ 2
n1 − n3 2 − n2 2 s α2 2 + c α2 2
2n1 n2 s α2 2 − 2n3 c α2 s α2
ra1 (α, n) = 
2n1 n3 s α2 2 + 2n2 c α2 s α2

α2
α
α
¡ 22n1 n2 s2 2 + 22n
¢ 3 c 22 s 2 2

α
n2 − n3 − n1 s 2 + c α2
ra2 (α, n) =
2n2 n3 s α2 2 − 2n1 c α2 s α2

2n1 n3 s α2 2 − 2n2 c α2 s α2

α
α
ra3 (α, n) = ¡ 2n2 n3 s α2 2 + 2n
¢ 1 c 22 s 2 2
2
2
2
α
n3 − n2 − n1 s 2 + c α2
(183)
(184)


(185)


(186)

.
(187)
This representation, while perhaps more intuitive than
the quaternion, is functionally equivalent to it: both require four parameters and a single quadratic constraint.
In order to overcome this problem, and produce a quaternion representation that requires only three parameters,
we will continue this development in Sec. 7.
Before moving on from the axis-angle representation,
we present some derivatives of key results. Differentiating
Eqs. 181-187 with respect to α and n yields
 1 ¡
¢ 
− 2 sα 1 − n 1 2 + n 2 2 + n 3 2
Here, we emphasize that we are constrained to consider
∂ra1

=
(188)
n1 n2 sα − n3 cα
only vectors n that satisfy the quadratic norm constraint,
∂α
n1 n3 sα + n2 cα
knk = 1. Differentiating with respect to α and n yields


· 1
¡ ¢ ¸
n1 n2 sα + n3 cα
∂qa
− 2 sin ¡ 12 α¢
¡
¢
∂r
a2
= 1
(176)
1
(189)
=  − 21 sα 1 + n1 2 − n2 2 + n3 2 
∂α
∂α
2 n cos 2 α
n2 n3 sα − n1 cα


·
¸
n1 n3 sα − n2 cα
∂qa
0T¡ ¢
∂ra3

=
(177)
=
(190)
¡n2 n3 sα + n1 cα
¢
I3 sin 12 α
∂n
∂α
− 21 sα 1 + n1 2 + n2 2 − n3 2


0
0
0


 sα

0
0
n1 (1 − cα ) n2 (1 − cα ) n3 (1 − cα )
2


∂Ra
=
.
(178)
 (191)
0 s α2
0 
sα
= n2 (1 − cα ) −n1 (1 − cα )
n1
n3 (1 − cα )
−sα
−n1 (1 − cα )
0
0 s α2
17
6.15
Unit Quaternion ⇒ Euler Angles


−n2 (1 − cα ) n1 (1 − cα )
−sα
∂Ra
=  n1 (1 − cα ) n2 (1 − cα ) n3 (1 − cα ) 
n2
sα
n3 (1 − cα ) −n2 (1 − cα )
(192)


−n3 (1 − cα )
sα
n1 (1 − cα )
∂Ra
−sα
−n3 (1 − cα ) n2 (1 − cα )
=
n3
n1 (1 − cα ) n2 (1 − cα ) n3 (1 − cα )
The inverse mapping, from a unit quaternion to a set of
Euler angles, is uijk (Rq (q)). These results are presented
with each Euler angle set in Sec. 8.
(193)
6.16
Because of their simplicity, mathematical elegance, and
lack of any singularities, quaternions are a very popular
representation for encoding the attitude of a rigid body.
This includes applications in which quaternions are included as state variables in an optimization. In these cases,
the difficult problem of how to impose the unity norm constraint arises. Various techniques are used to solve this
problem, though none of them are completely satisfactory.
For iterative optimization algorithms, such as the conjugate gradient algorithm, it is possible to simply re-normalize
the quaternions after each iteration. When using a direct
method, however, this strategy is usually insufficient. In
2
such cases, terms of the form c (1 − kqk) are also included
in the objective function to prevent large violations of the
constraint. Renormalization after each iteration is usually
still necessary.


−tα/2 −n1 −n2 −n3
cα/2 
∂Qa
−n2 
 n1 −tα/2 n3

=
−n3 −tα/2 n1 
∂α
2  n2
n3
n2
−n1 −tα/2

−tα/2 −n1 −n2 −n3
cα/2 
∂ Q̄a
n2 
 n1 −tα/2 −n3

=
n3 −tα/2 −n1 
∂α
2  n2
n3
−n2
n1 −tα/2
(194)

³ α ´ ∂Q
∂Qa
= sin
,
and
∂ni
2 ∂qi
³ α ´ ∂ Q̄
∂ Q̄a
= sin
, for i ∈ {1, 2, 3}.
∂ni
2 ∂qi
Optimization with Quaternions
(195)
(196)
(197)
Here, we have employed the shorthand tα/2 := tan(α/2)
in addition to the familiar sα/2 := sin(α/2) and cα/2 :=
cos(α/2). Expression for ∂Q/∂qi and ∂ Q̄/∂qi may be found
in Eqs. 116-118.
7
6.14
We define the rotation vector as a function of the axis and
angle of a rotation, va : R × S 2 → R3 , by
Rotation Vector Representation
One of the major drawbacks of quaternions is that they require a quadratic norm constraint in order to be valid rota6.13 Unit Quaternion ⇒ Axis-Angle
tions. This problem can be overcome by folding the unity
The inverse mappings, from a unit quaternion to the cor- norm constraint into the parametrization. There are sevresponding axis and angle of rotation, are αq : H → R and eral ways in which to do this, but we present what appears
to be the most natural three-dimensional parametrization
nq : H → S2 , defined by
of the quaternion representation of an object’s attitude.
αq (q) := 2acos(q0 )
(198)
q1:3
q1:3
nq (q) :=
.
(199) 7.1 Rotation Vector ⇐ Axis-Angle
=p
kq1:3 k
1 − q02
Unit Quaternion ⇐ Euler Angles
The unit quaternion arising from a particular Euler angle
va (α, n) := αn.
(204)
sequence may be written as the product of three axis-angle
unit quaternions. That is, for an Euler angle sequence,
(i, j, k), with rotation angles [φ, θ, ψ], the corresponding 7.2 Rotation Vector ⇒ Axis-Angle
unit quaternion is
Noting that knk = 1, we may invert this definition to yield
qijk (φ, θ, ψ) = qa (φ, êi ) · qa (θ, êj ) · qa (ψ, êk ).
(200) the functions αv : R3 → R and nv : R3 → S2 , defined by
Differentiating with respect to the Euler angles yields
¯
∂qijk (φ, θ, ψ)
∂qa ¯¯
=
· qa (θ, êj ) · qa (ψ, êk ) (201)
∂φ
∂α ¯φ,êi
¯
∂qa ¯¯
∂qijk (φ, θ, ψ)
= qa (φ, êi ) ·
· qa (ψ, êk )
(202)
∂θ
∂α ¯θ,êj
¯
∂qa ¯¯
∂qijk (φ, θ, ψ)
= qa (φ, êi ) · qa (θ, êj ) ·
. (203)
∂ψ
∂α ¯ψ,êk
αv (v) := kvk = v
v
v
nv (v) :=
= .
kvk
v
(205)
(206)
Here we have used the shorthand,
v := kvk.
This will be used throughout this article.
18
(207)
7.3
Rotation Vector ⇒ Unit Quaternion



0 1 0
−v1 v2
∂G −s v2 0 0 0
a  2v2
=

 + 3  2v
∂v2
2v 0 0 0
4v
1
0 0 0
0


0
0
0
2
v2 b  v v1 v2 v1 v3 
+ 5 1

4v v1 v2 v22 v2 v3
2
v1 v3 v2 v3 v3
We define the function that maps a rotation vector to a
unit quaternion, qv : R3 → H, by
·
¡ ¢ ¸
cos ¡v2 ¢
(208)
qv (v) := qa (αv (v), nv (v)) = v
v
v sin 2
·
lim qv (v) = lim
v→0
v→0
1
1
2v
¸
.
(209)
The derivatives of qv with respect to the parameters of
v are presented in this section. In order to provide compact expressions, we have factored them in terms of the
following two quantities:
a := c v2 v − 2s v2
b := −s v2 v − 6c v2 v + 12s v2 .
(211)
We differentiate Eq. 208 to yield
G(v) = [ g1 (v), g2 (v), g3 (v) ]
·
¸
∂qv
∂qv ∂qv ∂qv
:=
=
,
,
∂v
∂v1 ∂v2 ∂v3
· T¸
· T ¸
s v −v
a
0
+ 3
= 2
(212)
2v 2I3
2v vvT




−v1 −v2 −v3
0
0
0
2
v
s  2
a  v1 v1 v2 v1 v3 
0
0 
= 2 
+
(213)
0
2
0  2v 3 v1 v2 v2 2 v2 v3 
2v
2
0
0
2
v1 v3 v2 v3 v3


2 v
2 v
−v1 v s 2
−v2 v s 2
−v3 v 2 s v2

1 2v 2 s v2 + v1 2 a
v 1 v2 a
v 1 v3 a
 (214)
= 3
2 v
2


v1 v2 a
2v s 2 + v2 a
v 2 v3 a
2v
2 v
2
v1 v3 a
v2 v3 a
2v s 2 + v3 a

−v1
1 2
lim G(v) = 
0
v→0
4
0
−v2
0
2
0

−v3
0 
0 
2
7.4
·
¸
−1 êTi
∂G
=
v→0 ∂vi
4 03×3

−v32
2v1 
2v2 
6v3
(220)
Rotation Vector ⇐ Unit Quaternion
The inverse mapping, vq : H → R3 , which maps a unit
quaternion to a rotation vector, is defined by
vq (q) := αq (q)nq (q)
(221)
q1:3
= 2 acos(q0 )
kq1:3 k
2 acos(q0 )
=
1 q1:3
(1 − q02 ) 2
lim
kq1:3 k→0
vq (q) = 2q1:3
(222)
(223)
(224)
(215)
1
1 − q0 2
acos (q0 )
d := p
1 − q0 2
(225)
c :=
¸
·
·
¸
a
∂G −s v2 êTi
−vi vT
¡
¢
=
+ 3
∂vi
2v 03×3
4v 2 êi vT + vêTi + vi I3
· T ¸
vi b 0
+ 5
(216)
4v vvT
lim
(219)



0 0 1
−v1 v3 −v2 v3
v
−s
∂G
a  2v3
0
2 0 0 0
=

+ 3  0
2v3
∂v3
2v 0 0 0
4v
0 0 0
2v1
2v2


0
0
0
v3 b  v 2 v1 v2 v1 v3 
+ 5 1
.
4v v1 v2 v22 v2 v3
2
v1 v3 v2 v3 v3
(210)
2

−v22 −v2 v3
2v1
0 
6v2 2v3 
2v3 2v2


2cq1 (dq0 − 1) 2d 0
0
∂vq
=  2cq2 (dq0 − 1) 0 2d 0  (227)
H(q) :=
∂q
2cq3 (dq0 − 1) 0
0 2d
(217)


 2

1 0 0
−v1 −v1 v2 −v1 v3
v
∂G −s 2 0 0 0
a  6v1 2v2
2v3 
=

 + 3  2v
2v1
0 
∂v1
2v 0 0 0
4v
2
0 0 0
2v3
0
2v1


0
0
0
v1 b  v12 v1 v2 v1 v3 
(218)
+ 5

4v v1 v2 v22 v2 v3
2
v1 v3 v2 v3 v3
(226)

0
lim H(q) =  0
kq1:3 k→0
0
7.5
2
0
0
0
2
0

0
0 .
2
(228)
Rotation Vector ⇒ Quaternion Matrices
The quaternion matrices may be written as a function of
the rotation vector by composition of Eqs. 108 and 110,
19
Wv0 (v) := W 0 (qv (v))


−v1 s v2 vc v2
v3 s v2 −v2 s v2
1
−v2 s v −v3 s v vc v
v1 s v 
=
v −v s v2 v s v 2 −v 2s v vc v2
3 2
2 2
1 2
2
and Eq. 208:
Qv (v) := Q(qv (v))

vc v2 −v1 s v2 −v2 s v2 −v3 s v2
1
v
vc v2 −v3 s v2 v2 s v2
1 s v2
= 
vc v2 −v1 s v2
v  v2 s v2 v3 s v2
v3 s v2 −v2 s v2 v1 s v2
vc v2
Q̄v (v) := Q̄(qv (v))

vc v2 −v1 s v2 −v2 s v2 −v3 s v2

1 v1 s v2 vc v2
v3 s v2 −v2 s v2
= 
v

v
v
v1 s v2
v v2 s 2 −v3 s 2 vc 2
v
v
v
v3 s 2 v2 s 2 −v1 s 2 vc v2




(229)

2 −v1 −v2 −v3
1 v
2 −v3 v2 
lim Qv (v) =  1
v
v
2 −v1 
v→0
2
2
3
v3 −v2 v1
2
(230)
∂Qv
=
∂vj
i=0
∂Q ∂qvi
=
∂qi ∂vj
i=0
(231)
3
∂Qv
1 ∂Qv
=
v→0 ∂vj
2 ∂qj
3
(232)
7.7
7.6
Rotation Vector ⇒ Rotation Matrix
Rv (v) := Rq (qv (v))
£
¤
= rv1 (v) rv2 (v) rv3 (v) ,
the columns of which read
¢
¡ 2
v1 − v22 − v32 s2v + v 2 c2v
2
¡
¢2
1
rv1 (v) = 2  2s v2 ¡v1 v2 s v2 − vv3 c v2 ¢
v
2s v2 v1 v3 s v2 + vv2 c v2
¡
¢

2s v2 v1 v2 s v2 ¢+ vv3 c v2
¡
1
rv2 (v) = 2  v22 − ¡v32 − v12 s2v2 + v 2¢c2v2
v
2s v2 v2 v3 s v2 − vv1 c v2
¡
¢

2s v2 ¡v1 v3 s v2 − vv2 c v2 ¢
1
rv3 (v) = 2  ¡ 2s v2 v2 v3 s v2 ¢+ vv1 c v2
v
v32 − v12 − v22 s2v + v 2 c2v
(234)
(235)
(236)
2
For very small v, we have:

Rotation Vector ⇒ Quaternion Rates
Matrices
1
lim Rv (v) =  −v3
v→0
v2
The quaternion rates matrices may be written as a function
of the rotation vector by composition of Eqs. 150 and 151,
and Eq. 208:
Wv (v) := W (qv (v))


−v1 s v2 vc v2 −v3 s v2 v2 s v2
1
vc v −v1 s v2 
=  −v2 s v2 v3 s v2
v −v s v −v s v v s2v
vc v2
3 2
2 2
1 2
(242)
The rotation matrix may be written as a function of the
rotation vector by composition of Eqs. 125 and 208:
3
∂ Q̄v
1 ∂ Q̄v
lim
=
.
v→0 ∂vj
2 ∂qj
3
= W 0 (gj (v)) .
X ∂ Q̄ ∂qvi
X ∂ Q̄
∂ Q̄v
=
=
gij (v)
∂vj
∂qi ∂vj
∂qi
i=0
i=0
= Q̄ (gj (v))
(241)
X ∂W 0 ∂qvi
X ∂W 0
∂Wv0
=
=
gij (v)
∂vj
∂qi ∂vj
∂qi
i=0
i=0
(233)
lim
3
= W (gj (v))
∂Q
gij (v)
∂qi
= Q (gj (v))
(240)
3
The derivatives of the quaternion matrices with respect to
the rotation vector parameters are
3
X


−v1 2
v3 −v2
1
v1  .
lim Wv0 (v) =  −v2 −v3 2
v→0
2 −v v −v
2
3
2
1
X ∂W ∂qvi
X ∂W
∂Wv
=
=
gij (v)
∂vj
∂qi ∂vj
∂qi
i=0
i=0

3
X
(239)
The derivatives of the quaternion rates matrices with respect to the rotation vector parameters are


2 −v1 −v2 −v3
1 v
2
v3 −v2 
lim Q̄v (v) =  1
.
v1 
v→0
2 v2 −v3 2
v3 v2 −v1 2

−v1 2 −v3 v2
1
2 −v1 
lim Wv (v) =  −v2 v3
v→0
2 −v −v v
2
3
2
1





(238)
v3
1
−v1
(243)


(244)


(245)

.
(246)
2

−v2
v1  .
1
(247)
The derivatives of the rotation matrix with respect to the
parameters of the rotation vector are
h
i
∂Rv
∂rv2
∂rv3
v1
= ∂r
∂vj
∂vj
∂vj
∂vj
¯
3
X
∂Rq ¯¯
∂qvi
.
(248)
=
¯
∂qi qv (v) ∂vj
i=0
(237)
20
7.10
where
∂rvi
= Fi (qv (v)) gj (v)
∂vj

q0
F1 (q) = −q3
q2

q3
F2 (q) =  q0
−q1

−q2
F3 (q) =  q1
q0

q1 −q2 −q3
q2 q1 −q0 
q3 q0 q1

q2 q1 q0
−q1 q2 −q3 
−q0 q3 q2

q3 −q0 q1
q0 q3 q2 
−q1 −q2 q3
∂Rv
lim
= −C(êi )
v→0 ∂vj

0 0 0
∂Rv
lim
= 0 0 1
v→0 ∂v1
0 −1 0

∂Rv
lim
=
v→0 ∂v3
7.8

,
0
−1
0
(249)
(250)
Rotation Vector Rates ⇒ Angular Velocity
The time derivative of the rotation vector is the vector
of rotation vector rates. The rotation vector rates, v̇, are
related to the angular velocity. The functions that map a
rotation vector and its temporal derivative to the angular
velocity in world and body-fixed coordinates are ωv : R3 ×
R3 → R3 and ω0v : R3 × R3 → R3 , defined by
ωv (v, v̇) := 2Wv (v)q̇v (v)
= 2Wv (v)G(v)v̇
= 2V (v)v̇
ω0v (v, v̇) := 2Wv0 (v)q̇v (v)
= 2Wv0 (v)G(v)v̇
(251)
(252)
= 2V (v)T v̇,
(253)
(260)
where the rotation vector rates matrix, V : R3 → R3×3 , is
defined by


0 0 −1
∂Rv
lim
=  0 0 0 ,
v→0 ∂v2
1 0 0

1 0
0 0 .
(254)
0 0
Rotation Vector Multiplication
(259)
V (v) := Wv (v)G(v),
(261)
where Wv (v) and G(v) are defined in Eqs. 237 and 212.
As it also holds that ω0 = Rv (v)ω, we have that
Rv (v) = V (v)T V (v)−1
T
−T
Rv (v) = V (v)V (v)
7.11
The multiplication of two rotation vectors u and v ∈ R3 is
defined in terms of the product of quaternions:
.
(262)
(263)
Rotation Vector Rates ⇐ Angular Velocity
The functions that map the angular velocity in the bodyfixed and world coordinates to the rotation vector rates,
v̇ω : R3 × R3 → R3 and v̇ω0 : R3 × R3 → R3 , are defined
This product is best computed as written, by converting by
each rotation vector to a unit quaternion, performing the
1
quaternion product, and then converting back to a rotation
v̇ω (v, ω) = V (v)−1 ω
(264)
2
vector.
1
The derivatives of the rotation vector multiplication
v̇ω0 (v, ω0 ) = V (v)−T ω0 .
(265)
2
function are
v ∗ u = vm (v, u) = vq (qm (qv (v), qv (u))) .
(255)
∂vm(v,u)
= H(qm (qv (v), qv (u)) Q̄ (qv (u)) G(v) (256)
∂v
∂vm(v,u)
= H(qm (qv (v), qv (u)) Q (qv (v)) G(u). (257)
∂u
7.12
Quaternions are very well suited to tracking the attitude
of an object by integrating the body-fixed angular velocity
over time.
Consider an object with a body-fixed angular velocity
of ω0 (t). Let us consider the change in attitude from time
t0 to time t1 . We define the rotation vector over this interval to be
Z t1
vω0 (t0 , t1 ) :=
ω0 (t) dt.
(266)
Here, H(q), Q̄(q), and G(v) are given in Eqs. 227 , 110,
and 212.
7.9
Integration of Angular Velocity
Rotation Vector Rates ⇒ Quaternion
Rates
t0
The quaternion rates as a function of the rotation vector
3
4
rates are given in the function q̇v : H × R → R , defined If the body-fixed angular velocity is provided as discrete
by
samples, as, for example, from a set of rate gyros, the integration will have to be carried out numerically. The sim∂qv ∂v
q̇v (q, v̇) =
= G(v)v̇.
(258) plest such numerical integration is to compute the product
∂v ∂t
of the time interval and the average of all the samples taken
Here, G(v) is given in Eq. 212.
during that time interval.
21
If at time t0 the body has a quaternion attitude of q0 ,
then the attitude at time t1 is
q1 = [qv ◦ vω0 (t0 , t1 )] · q0
= qv (vω0 (t0 , t1 )) · q0 .
(267)
This equation may be easily generalized to read
qi+1 = qv (vω0 (ti , ti+1 )) · qi ,
(268)
giving us a simple update rule for tracking the attitude of
an object over time, given some measure of the body-fixed
angular velocity. This method is much more accurate than
integrating the Euler angle rates.
8
A Catalog of Euler Angle Parameterizations
In this section we present an exhaustive catalog of the
twelve different Euler angle parameterizations, including
conversions to and from rotation matrices and quaternions,
the relationship between the Euler angle rates and the angular velocity, and various derivatives of the fundamental
results with respect to the Euler angles.
22
8.1
Euler Angle Sequence (1,2,1)
R121 (φ, θ, ψ) = R1 (φ)R2 (θ)R1 (ψ) =


cθ
sθ sψ
−sθ cψ
 sφ sθ cφ cψ − sφ cθ sψ
cφ sψ + sφ cθ cψ 
cφ sθ −sφ cψ − cφ cθ sψ −sφ sψ + cφ cθ cψ

1
L{R121 (φ, θ, ψ)} =  0
θ
z
z′′′
z′′
ψ
y′
θ
(269)
z′
φ

0
1
−φ − ψ
−θ
ψ+φ 
1
 

φ121 (R)
atan2 (r21 , r31 )

u121 (R) =  θ121 (R)  =  acos (r11 )
ψ121 (R)
atan2 (r12 , −r13 )
(270)

¡

atan2 2q1 q2 − 2q0 q3 ¢,


1 q3 + 2q0 q2

¡ 2q
¢
2
2
2
2 

u121 (Rq (q)) =  acos q¡1 + q0 − q3 − q2 
 atan2 2q1 q2 + 2q0 q3 ,

¢
−2q1 q3 + 2q0 q2
ψ
(271)
x, x′′′
cθ
E121 (φ, θ, ψ) =  sθ sψ
−sθ cψ
0
cψ
sψ

1
0 
0
0
1
ψ

1
0 
0

1
L{E121 (φ, θ, ψ)} =  0
−θ


1
0
L{E121
(φ, θ, ψ)} =  0
0
−1
[E121 (φ, θ, ψ)]
−1
0
[E121
(φ, θ, ψ)]

0
1 
0
=
sθ
sθ

s
1  θ
0
=
sθ
0
(272)
x′′, x′
Figure 5: Euler Angle Sequence (1,2,1)
(273)

−sθ
∂R121
=  sφ cθ
∂θ
cφ cθ
(274)
cθ
sφ sθ 
cφ sθ
(275)

1
0 
θ
(276)
0
1
−φ
sψ
sθ cψ
−cθ sψ
−sφ cθ
cφ sθ
sφ

−cψ
sθ sψ 
cθ cψ
(277)

−cφ cθ
−sφ sθ 
cφ
(278)

cφ/2 cθ/2 cψ/2 − sφ/2 cθ/2 sψ/2
 cφ/2 cθ/2 sψ/2 + cθ/2 cψ/2 sφ/2 

q121 (φ, θ, ψ) = 
 cφ/2 cψ/2 sθ/2 + sφ/2 sθ/2 sψ/2 
cφ/2 sθ/2 sψ/2 − sφ/2 cψ/2 sθ/2
0
−sφ cψ − cφ cθ sψ
−cφ cψ + sφ cθ sψ
−sθ
=  cθ sψ
−cθ cψ
∂E121
∂θ

∂E121
∂ψ
0
=  sθ cψ
sθ sψ

0
∂E121
∂φ
0
0
=  0 −sφ
0 −cφ

0
∂E121
(279)
∂θ

0
−sφ sψ + cφ cθ cψ  (280)
−cφ sψ − sφ cθ cψ
23

−cθ cψ
−sφ sθ cψ 
−cφ sθ cψ

sθ sψ
cφ cψ − sφ cθ sψ 
−sφ cψ − cφ cθ sψ


∂R121
=
∂φ

0
 cφ sθ
−sφ sθ
cθ sψ
sφ sθ sψ
cφ sθ sψ
∂R121
=
∂ψ

0
sθ cψ
 0 −cφ sψ − sφ cθ cψ
0 sφ sψ − cφ cθ cψ

1
0
0
E121
(φ, θ, ψ) =  0 cφ
0 −sφ
y
θ


y′′′, y′′
φ
0 0
= 0 0
0 0
0
0
0
0
−sψ
cψ

0
0 
0

0
0 
0
(281)
(282)
(283)
(284)

0
cφ sθ 
−sφ sθ
(285)

−sθ
sφ c θ 
cφ cθ
(286)
8.2
Euler Angle Sequence (1,2,3)
z, z′′′
R123 (φ, θ, ψ) = R1 (φ)R2 (θ)R3 (ψ) =


cθ cψ
cθ sψ
−sθ
 sφ sθ cψ − cφ sψ sφ sθ sψ + cφ cψ cθ sφ 
cφ sθ cψ + sφ sψ cφ sθ sψ − sφ cψ cθ cφ


ψ −θ
1
φ 
−φ 1
1
L{R123 (φ, θ, ψ)} =  −ψ
θ



z′′
z′
θ
φ
(287)
y′
(288)
φ
y′′′, y′′
ψ

φ123 (R)
atan2 (r23 , r33 )

u123 (R) =  θ123 (R)  =  −asin (r13 )
ψ123 (R)
atan2 (r12 , r11 )
¡

atan2 2q2 q3 + 2q0 q1 ,
¢
2
2
2
2 


¡q3 − q2 − q1¢ + q0 


u123 (Rq (q)) =  −asin¡ 2q1 q3 − 2q0 q2


 atan2 2q1 q2 + 2q0 q3 ,
¢
2
2
2
2
q1 + q0 − q3 − q2
x
ψ
x′′′
(289)
y
θ


cθ cψ
E123 (φ, θ, ψ) =  cθ sψ
−sθ

1
L{E123 (φ, θ, ψ)} =  ψ
−θ
1
0
L{E123
(φ, θ, ψ)} =  0
0

−1
[E123 (φ, θ, ψ)]
cψ
1 
−cθ sψ
=
cθ
cψ sθ

−1
0
[E123
(φ, θ, ψ)]
c
1  θ
0
=
cθ
0
0
1
−φ

−cψ sθ
∂R123
=  sφ cθ cψ
∂θ
cφ cθ cψ
∂R123
=
∂ψ

−cθ sψ
 −sφ sθ sψ − cφ cψ
−cφ sθ sψ + sφ cψ
(293)
∂E123
∂θ
−θ
φ 
1
(294)
∂E123
∂ψ

cφ sθ
−sφ cθ 
cφ
(295)
∂φ
(296)
0
cφ sθ sψ − sφ cψ
−sφ sθ sψ − cφ cψ
0
0
=  0 −sφ
0 −cφ


cφ/2 cθ/2 cψ/2 + sφ/2 sθ/2 sψ/2
 −cφ/2 sθ/2 sψ/2 + cθ/2 cψ/2 sφ/2 

q123 (φ, θ, ψ) = 
 cφ/2 cψ/2 sθ/2 + sφ/2 cθ/2 sψ/2  (297)
cφ/2 cθ/2 sψ/2 − sφ/2 cψ/2 sθ/2
0
 cφ sθ cψ + sφ sψ
−sφ sθ cψ + cφ sψ
−cθ sψ
=  cθ cψ
0
0
∂E123

∂R123
=
∂φ

−cψ sθ
=  −sψ sθ
−cθ

0
∂E123
∂θ

0
cφ cθ  (298)
−sφ cθ
24

−cθ
−sφ sθ 
−cφ sθ
cθ cψ
sφ sθ cψ − cφ sψ
cφ sθ cψ + sφ sψ


0
0 
cθ
−sψ sθ
sφ cθ sψ
cφ cθ sψ


sψ
cθ cψ
sψ sθ
sφ sθ
cφ cθ
sφ
Figure 6: Euler Angle Sequence (1,2,3)
(292)

−sθ
cθ sφ 
cθ cφ
1
0
0
E123
(φ, θ, ψ) =  0 cφ
0 −sφ
(290)
(291)

0
0 
1
−ψ
1
0



0
0 
1
−sψ
cψ
0
x′′, x′
0 0
= 0 0
0 0

0
0 
0

0 0
0 0 
0 0
(299)
(300)
(301)

0
0 
0
(302)

0
cφ cθ 
−sφ cθ
(303)
−cψ
−sψ
0

−cθ
−sφ sθ 
−cφ sθ
(304)
8.3
Euler Angle Sequence (1,3,1)
y′
z
z′′′, z′′
y′′
R131 (φ, θ, ψ) = R1 (φ)R3 (θ)R1 (ψ) =


cθ
cψ sθ
sψ sθ
 −cφ sθ cφ cθ cψ − sφ sψ
cφ cθ sψ + sφ cψ  (305)
sφ sθ −sφ cθ cψ − cφ sψ −sφ cθ sψ + cφ cψ

1
L{R131 (φ, θ, ψ)} =  −θ
0

0
ψ+φ 
1
θ
1
−φ − ψ
 

φ131 (R)
atan2 (r31 , −r21 )

u131 (R) =  θ131 (R)  =  acos (r11 )
ψ131 (R)
atan2 (r13 , r12 )
ψ
φ
z′
y′′′
φ
θ
ψ
(306)
y

¡

atan2 2q1 q3 + 2q0 q2 , ¢


1 q2 + 2q0 q3

¡ −2q
¢
2
2
2
2 

u131 (Rq (q)) =  acos q¡1 + q0 − q3 − q2 
 atan2 2q1 q3 − 2q0 q2 ,

¢
2q1 q2 + 2q0 q3
(307)
x, x′′′


cθ
E131 (φ, θ, ψ) =  cψ sθ
sψ sθ

1
L{E131 (φ, θ, ψ)} =  θ
0

1
0
E131
(φ, θ, ψ) =  0
0
1
0
L{E131
(φ, θ, ψ)} =  0
0
−1
[E131 (φ, θ, ψ)]
=
0
1 
0
sθ
sθ

−1
0
[E131
(φ, θ, ψ)]
=
s
1  θ
0
sθ
0
0
−ψ
1

1
0 
0
Figure 7: Euler Angle Sequence (1,3,1)

(308)
∂R131
∂θ

1
0 
0
(310)
cθ
−cφ sθ 
sφ sθ
sψ
sθ cψ 
−cθ sψ
−sφ cθ
cφ sθ 
sφ
(319)
(313)
(314)

0 0
0
∂E131
= 0 0
∂θ
0 0

−sφ cθ sψ + cφ cψ 
−cφ cθ sψ − sφ cψ

0 0
0 0 
0 0

0
0
∂E131
= 0
∂φ
0

cφ/2 cθ/2 cψ/2 − sφ/2 cθ/2 sψ/2
 cφ/2 cθ/2 sψ/2 + cθ/2 cψ/2 sφ/2 

q131 (φ, θ, ψ) = 
 −cφ/2 sθ/2 sψ/2 + sφ/2 cψ/2 sθ/2  (315)
cφ/2 cψ/2 sθ/2 + sφ/2 sθ/2 sψ/2
0
(318)
(312)

∂R131
=
∂φ

0
0
 sφ sθ −sφ cθ cψ − cφ sψ
cφ sθ −cφ cθ cψ + sφ sψ

sθ cψ
cφ cθ cψ − sφ sψ 
−sφ cθ cψ − cφ sψ

0
∂E131
=  −sθ sψ
∂ψ
sθ cψ

cφ cθ
sφ sθ
−cφ
(317)
(311)

cψ
−sθ sψ
−cθ cψ

cθ sψ
−cφ sθ sψ 
sφ sθ sψ
cθ cψ
−cφ sθ cψ
sφ sθ cψ

−sθ
∂E131
=  cθ cψ
∂θ
cθ sψ

0 1
φ −θ 
1 0
−sθ
=  −cφ cθ
sφ cθ
∂R131
=
∂ψ

0
−sθ sψ
 0 −cφ cθ sψ − sφ cψ
0 sφ cθ sψ − cφ cψ
(309)

0
sφ
cφ


0
−sψ
cψ
x′′, x′
θ
(316)
25
0
cφ
−sφ
0
−cψ
−sψ

0
0 
0
(320)

0
sφ sθ 
cφ sθ
(321)

−sθ
−cφ cθ 
sφ c θ
(322)
8.4
Euler Angle Sequence (1,3,2)
z
R132 (φ, θ, ψ) = R1 (φ)R3 (θ)R2 (ψ) =


cθ cψ
sθ
−cθ sψ
 −cφ sθ cψ + sφ sψ cφ cθ
cφ sθ sψ + sφ cψ  (323)
sφ sθ cψ + cφ sψ −sφ cθ −sφ sθ sψ + cφ cψ

1
L{R132 (φ, θ, ψ)} =  −θ
ψ



θ −ψ
1
φ 
−φ 1

z′′′, z′′
ψ
z′
φ
φ
θ

¡

atan2 −2q2 q3 + 2q0 q1 ,
¢
2
2
2
2 


¡ q2 − q3 + ¢q0 − q1 


u132 (Rq (q)) =  asin 2q

¡ 1 q2 + 2q0 q3

 atan2 −2q1 q3 + 2q0 q2 ,
¢
2
2
2
2
q1 + q0 − q3 − q2
x
(325)
cθ cψ
sθ
−cθ sψ

1
L{E132 (φ, θ, ψ)} =  θ
−ψ

1
0
E132
(φ, θ, ψ) =  0
0
0
sφ
cφ

1
0
L{E132
(φ, θ, ψ)} =  0
0

−1
[E132 (φ, θ, ψ)]
cψ
1 
cθ sψ
cθ
−sθ cψ
=

−1
0
[E132
(φ, θ, ψ)]
=
c
1  θ
0
cθ
0
sψ
0
cψ
ψ
0
1
θ
x′′′
(326)
0
1 
0
Figure 8: Euler Angle Sequence (1,3,2)

−sθ cψ
∂R132
=  −cφ cθ cψ
∂θ
sφ cθ cψ
(327)

0
1 
0
∂R132
=
∂ψ

−cθ sψ
 cφ sθ sψ + sφ cψ
−sφ sθ sψ + cφ cψ
(328)
sθ
cφ cθ 
−sφ cθ
(329)
0 θ
φ 1 
1 −φ
(330)
(331)

cφ/2 cθ/2 cψ/2 − sφ/2 sθ/2 sψ/2
 cφ/2 sθ/2 sψ/2 + cθ/2 cψ/2 sφ/2 

q132 (φ, θ, ψ) = 
 cφ/2 cθ/2 sψ/2 + sφ/2 cψ/2 sθ/2 
cφ/2 cψ/2 sθ/2 − sφ/2 cθ/2 sψ/2
(332)
0
 sφ sθ cψ + cφ sψ
cφ sθ cψ − sφ sψ
0
−sφ cθ
−cφ cθ
0
(333)

−sφ sθ sψ + cφ cψ 
−cφ sθ sψ − sφ cψ

−cθ cψ
cφ sθ cψ − sφ sψ 
−sφ sθ cψ − cφ sψ
(336)
0
cφ
−sφ

0 0
0
∂E132
= 0 0
∂θ
0 0

∂R132
=
∂φ

0
0
0

0
0
∂E132
= 0
∂φ
0

sφ sθ
cφ cθ 
−sφ
(335)

−cθ sψ
∂E132
0
=
∂ψ
−cθ cψ

−sψ
cθ cψ 
sψ sθ

sψ sθ
cφ cθ sψ 
−sφ cθ sψ
cθ
−cφ sθ
sφ sθ

−sθ cψ
∂E132
=  cθ
∂θ
sψ sθ

−cφ sθ
sφ cθ
cφ
x′′, x′


0
0
cθ
y, y′′′
ψ

E132 (φ, θ, ψ) = 
y′′
(324)
φ132 (R)
atan2 (−r32 , r22 )

u132 (R) =  θ132 (R)  =  asin (r12 )
ψ132 (R)
atan2 (−r13 , r11 )

y′
(334)
26

0 0
0 0 
0 0
(337)

0
0 
0
(338)

0
−sφ cθ 
−cφ cθ
(339)
cψ
0
−sψ

cθ
−cφ sθ 
sφ sθ
(340)
8.5
Euler Angle Sequence (2,1,2)
z
R212 (φ, θ, ψ) = R2 (φ)R1 (θ)R2 (ψ) =


cφ cψ − sφ cθ sψ sθ sφ −cφ sψ − sφ cθ cψ


sθ sψ
cθ
sθ cψ
sφ cψ + cφ cθ sψ −sθ cφ −sφ sψ + cφ cθ cψ

1
0
L{R212 (φ, θ, ψ)} = 
φ+ψ
ψ
(341)
θ
z′

0
1
−θ
z′′′
z′′
−ψ − φ

θ
1
φ
y′′, y′
(342)
 

φ212 (R)
atan2 (r12 , −r32 )

u212 (R) =  θ212 (R)  =  acos (r22 )
ψ212 (R)
atan2 (r21 , r23 )
θ

y, y′′′
x
(343)
¡

atan2 2q1 q2 + 2q0 q3 , ¢


2 q3 + 2q0 q1

¡ −2q
¢
2
2
2
2 

u212 (Rq (q)) =  acos q¡2 − q3 + q0 − q1 
 atan2 2q1 q2 − 2q0 q3 ,

¢
2q2 q3 + 2q0 q1
ψ


sθ sψ
E212 (φ, θ, ψ) =  cθ
sθ cψ

0
L{E212 (φ, θ, ψ)} =  1
θ

0 cφ
0
E212
(φ, θ, ψ) =  1 0
0 sφ

0
0
L{E212
(φ, θ, ψ)} =  1
0
−1
[E212 (φ, θ, ψ)]

sψ
1 
sθ cψ
=
sθ
−cθ sψ
−1
0
[E212
(φ, θ, ψ)]

−sφ cθ
1 
sθ cφ
=
sθ
sφ
cψ
0
−sψ
1
0
−ψ
φ
x′′′, x′′
(344)
x′

0
1 
0
Figure 9: Euler Angle Sequence (2,1,2)
(345)

sφ sθ sψ
∂R212
=  cθ sψ
∂θ
−cφ sθ sψ

0
1 
0
(346)
∂R212
=
∂ψ

−cφ sψ − sφ cθ cψ

sθ cψ
−sφ sψ + cφ cθ cψ

sθ sφ
cθ 
−sθ cφ
(347)

1 0
0 1 
φ −θ
(348)
0
0
sθ
sθ
0
0

cψ
−sθ sψ 
−cψ cθ
(349)

cφ cθ
sθ sφ 
−cφ
(350)
sθ cφ
0
sθ sφ

sφ sψ − cφ cθ cψ

0
−cφ sψ − sφ cθ cψ

0 −cφ cψ + sφ cθ sψ

0
−sθ sψ
0 −sφ cψ − cφ cθ sψ
(354)

sθ cψ
∂E212
0
=
∂ψ
−sθ sψ

0 −sφ
0
∂E212
0
= 0
∂φ
0 cφ
cφ/2 cθ/2 cψ/2 − sφ/2 cθ/2 sψ/2
 cφ/2 cψ/2 sθ/2 + sφ/2 sθ/2 sψ/2 

q212 (φ, θ, ψ) = 
 cφ/2 cθ/2 sψ/2 + cθ/2 cψ/2 sφ/2  (351)
−cφ/2 sθ/2 sψ/2 + sφ/2 cψ/2 sθ/2
∂R212
=
∂φ

−sφ cψ − cφ cθ sψ

0
cφ cψ − sφ cθ sψ
(353)

cθ sψ
∂E212
=  −sθ
∂θ
cθ cψ



sφ sθ cψ
cθ cψ 
−cφ sθ cψ
sφ cθ
−sθ
−cφ cθ

0 0
0
∂E212
= 0 0
∂θ
0 0
(352)
27

0 0
0 0 
0 0
−sψ
0
−cψ

0
0 
0
(355)
(356)

sθ cφ
0 
sθ sφ
(357)

sφ c θ
−sθ 
−cφ cθ
(358)
8.6
Euler Angle Sequence (2,1,3)
z, z′′′
z′′
R213 (φ, θ, ψ) = R2 (φ)R1 (θ)R3 (ψ) =


cφ cψ − sφ sθ sψ cφ sψ + sφ sθ cψ −cθ sφ

−cθ sψ
cθ cψ
sθ 
sφ cψ + cφ sθ sψ sφ sψ − cφ sθ cψ cφ cθ

1
L{R213 (φ, θ, ψ)} =  −ψ
φ



−φ
θ 
1
ψ
1
−θ

z′
θ
φ
(359)
y′′, y′
θ
(360)
φ213 (R)
atan2 (−r13 , r33 )

u213 (R) =  θ213 (R)  =  asin (r23 )
ψ213 (R)
atan2 (−r21 , r22 )
¡

atan2 −2q1 q3 + 2q0 q2 ,
¢
2
2
2
2 


¡ q3 − q2 − ¢q1 + q0 


u213 (Rq (q)) =  asin 2q

¡ 2 q3 + 2q0 q1

 atan2 −2q1 q2 + 2q0 q3 ,
¢
2
2
2
2
q2 − q3 + q0 − q1
y′′′
ψ

x
(361)
ψ
x′′′, x′′
y
φ


−cθ sψ
E213 (φ, θ, ψ) =  cθ cψ
sθ

−ψ
L{E213 (φ, θ, ψ)} =  1
θ

0
0
E213
(φ, θ, ψ) =  1
0
0
0
L{E213
(φ, θ, ψ)} =  1
0

−1
[E213 (φ, θ, ψ)]
=
−sψ
1 
cθ cψ
cθ
sψ sθ

−1
0
[E213
(φ, θ, ψ)]
=
s s
1  φ θ
cφ cθ
cθ
−sφ
(362)
Figure 10: Euler Angle Sequence (2,1,3)

−sφ cθ sψ
∂R213
=  sψ sθ
∂θ
cφ cθ sψ

cψ
sψ
0
0
0 
1
1
ψ
0

0
0 
1
(363)
∂R213
=
∂ψ

−cφ sψ − sφ sθ cψ

−cθ cψ
−sφ sψ + cφ sθ cψ
(364)

cφ
0
sφ

x′
−cθ sφ
sθ 
cφ cθ
(365)
∂E213
∂θ
cψ
cθ sψ
−cψ sθ
cθ
0
0
(366)
0
0 
cθ
∂E213
∂ψ
(367)

cφ/2 cθ/2 cψ/2 − sφ/2 sθ/2 sψ/2
 cφ/2 cψ/2 sθ/2 − sφ/2 cθ/2 sψ/2 

q213 (φ, θ, ψ) = 
 cφ/2 sθ/2 sψ/2 + cθ/2 cψ/2 sφ/2 
cφ/2 cθ/2 sψ/2 + sφ/2 cψ/2 sθ/2
∂φ
−sφ sψ + cφ sθ cψ
0
cφ sψ + sφ sθ cψ
0 −sφ
0
= 0
0 cφ
(368)

0
∂E213

∂R213
=
∂φ

−sφ cψ − cφ sθ sψ

0
cφ cψ − sφ sθ sψ
−cθ cψ
=  −cθ sψ
0

0
∂E213

−cφ sθ
sφ cθ 
cφ
sψ sθ
=  −cψ sθ
cθ


∂θ
(369)

−cφ cθ
 (370)
0
−sφ cθ
28

sφ sθ
cθ 
−cφ sθ
(371)

0
0 
0
(372)
cφ cψ − sφ sθ sψ
−cθ sψ
sφ cψ + cφ sθ sψ


1 −φ
0 θ 
φ 1
sφ cθ cψ
−cψ sθ
−cφ cθ cψ
0 0
= 0 0
0 0

0 0
0 0 
0 0
(373)

0
0 
0
(374)

−cφ cθ

0
−sφ cθ
(375)
−sψ
cψ
0

sφ sθ
cθ 
−cφ sθ
(376)
8.7
Euler Angle Sequence (2,3,1)
z′′′, z′′
z
z′
R231 (φ, θ, ψ) = R2 (φ)R3 (θ)R1 (ψ) =


cφ cθ cφ sθ cψ + sφ sψ cφ sθ sψ − sφ cψ
 −sθ

cθ cψ
cθ sψ
sφ cθ sφ sθ cψ − cφ sψ sφ sθ sψ + cφ cψ

1
L{R231 (φ, θ, ψ)} =  −θ
φ

−φ
ψ 
1
θ
1
−ψ
φ
(377)
(378)
x′′
¡

atan2 2q1 q3 + 2q0 q2 ,
¢
2
2
2
2 


¡q1 + q0 − q3¢ − q2 


u231 (Rq (q)) =  −asin¡ 2q1 q2 − 2q0 q3


 atan2 2q2 q3 + 2q0 q1 ,
¢
2
2
2
2
q2 − q3 + q0 − q1
0
−sψ
cψ

−θ
L{E231 (φ, θ, ψ)} =  1
ψ

0
0
E231
(φ, θ, ψ) =  1
0
0
−ψ
1
(379)
y
x′
−sφ
0
cφ
−1
=
0
1 
0
cθ
cθ

−1
0
[E231
(φ, θ, ψ)]
=
cψ
−cθ sψ
sθ cψ
c s
1  φ θ
−sφ cθ
cθ
cφ

(380)
∂R231
∂θ

1
0 
0
(382)
cθ
0
0
(384)
(385)

0
0
∂E231
= 0
∂φ
0

sφ sθ
cφ cθ 
sφ
(386)

cφ/2 cθ/2 cψ/2 + sφ/2 sθ/2 sψ/2
 cφ/2 cθ/2 sψ/2 − sφ/2 cψ/2 sθ/2 

q231 (φ, θ, ψ) = 
 −cφ/2 sθ/2 sψ/2 + cθ/2 cψ/2 sφ/2  (387)
cφ/2 cψ/2 sθ/2 + sφ/2 cθ/2 sψ/2

∂R231
=
∂φ

−sφ cθ

0
cφ cθ
−sφ sθ cψ + cφ sψ
0
cφ sθ cψ + sφ sψ
−cφ
0
−sφ

0 0
0
∂E231
= 0 0
∂θ
0 0


−sφ sθ sψ − cφ cψ
 (388)
0
cφ sθ sψ − sφ cψ
29

cφ cθ sψ
−sθ sψ 
sφ cθ sψ

cφ sθ cψ + sφ sψ

cθ cψ
sφ sθ cψ − cφ sψ

0
∂E231
=  −cθ sψ
∂ψ
cθ cψ

sψ
cθ cψ 
sθ sψ
cφ cθ cψ
−sθ cψ
sφ cθ cψ

−cθ
∂E231
=  −sθ cψ
∂θ
−sθ sψ
(383)
1
−θ 
φ
−cφ sθ
=  −cθ
−sφ sθ
∂R231
=
∂ψ

0 −cφ sθ sψ + sφ cψ
 0
−cθ sψ
0 −sφ sθ sψ − cφ cψ
(381)
cφ cθ
−sθ 
sφ cθ
0 −φ
0
L{E231
(φ, θ, ψ)} =  1 0
0 1
[E231 (φ, θ, ψ)]
Figure 11: Euler Angle Sequence (2,3,1)




1
0 
0
φ
x, x′′′

−sθ
E231 (φ, θ, ψ) =  cθ cψ
cθ sψ
ψ
θ
 

φ231 (R)
atan2 (r31 , r11 )

u231 (R) =  θ231 (R)  =  −asin (r21 )
ψ231 (R)
atan2 (r23 , r22 )
y′′, y′
y′′′
θ


ψ

0 0
0 0 
0 0
(389)
(390)
(391)

0
0 
0
(392)

−sφ cθ

0
cφ cθ
(393)
0
−cψ
−sψ

−cφ sθ
−cθ 
−sφ sθ
(394)
8.8
Euler Angle Sequence (2,3,2)
z
z′′′, z′′
R232 (φ, θ, ψ) = R2 (φ)R3 (θ)R2 (ψ) =


cφ cθ cψ − sφ sψ cφ sθ −cφ cθ sψ − sφ cψ


−sθ cψ
cθ
sθ sψ
sφ cθ cψ + cφ sψ sφ sθ −sφ cθ sψ + cφ cψ

1
L{R232 (φ, θ, ψ)} =  −θ
φ+ψ
ψ
(395)
z′

−ψ − φ

0
1
θ
1
0
y′′, y′
(396)
θ

 

φ232 (R)
atan2 (r32 , r12 )

u232 (R) =  θ232 (R)  =  acos (r22 )
ψ232 (R)
atan2 (r23 , −r21 )
¡

atan2 2q2 q3 − 2q0 q1 ¢,


1 q2 + 2q0 q3

¡ 2q
¢
2
2
2
2 

u232 (Rq (q)) =  acos q¡2 − q3 + q0 − q1 
 atan2 2q2 q3 + 2q0 q1 ,

¢
−2q1 q2 + 2q0 q3
x
y, y′′′
(397)
ψ
θ


−sθ cψ
E232 (φ, θ, ψ) =  cθ
sθ sψ
sψ
0
cψ

−θ
L{E232 (φ, θ, ψ)} =  1
0

0
0
E232
(φ, θ, ψ) =  1
0
0
0
L{E232
(φ, θ, ψ)} =  1
0
−1
−1
0
[E232
(φ, θ, ψ)]

−cψ
1 
sθ sψ
=
sθ
cθ cψ

−cφ cθ
1 
−sφ sθ
=
sθ
cφ

0
1 
0
x′′′
(398)
Figure 12: Euler Angle Sequence (2,3,2)
(399)

−cφ sθ cψ
∂R232
=  −cθ cψ
∂θ
−sφ sθ cψ

0
1 
0
(400)
cφ sθ
cθ 
sφ sθ
(401)

θ
1 
0
(402)

sψ
sθ cψ 
−sψ cθ
(403)
−φ
0
1
0
0
sθ
sθ
0
0

−sφ cθ
cφ sθ 
sφ
cφ/2 cθ/2 cψ/2 − sφ/2 cθ/2 sψ/2
 cφ/2 sθ/2 sψ/2 − sφ/2 cψ/2 sθ/2 

q232 (φ, θ, ψ) = 
 cφ/2 cθ/2 sψ/2 + cθ/2 cψ/2 sφ/2 
cφ/2 cψ/2 sθ/2 + sφ/2 sθ/2 sψ/2
−sφ sθ
0
cφ sθ
x′′
x′
∂R232
=
∂ψ

−cφ cθ sψ − sφ cψ

sθ sψ
−sφ cθ sψ + cφ cψ
cφ cθ
−sθ
sφ cθ
−cθ cψ
=  −sθ
cθ sψ
∂E232
∂θ

∂E232
∂ψ
sθ sψ
= 0
sθ cψ

(404)
0
∂E232
∂φ
0
= 0
0

(405)
0
∂E232
∂θ

sφ cθ sψ − cφ cψ
 (406)
0
−cφ cθ sψ − sφ cψ
30

cφ sθ sψ
cθ sψ 
sφ sθ sψ

0 −cφ cθ cψ + sφ sψ

0
sθ cψ
0 −sφ cθ cψ − cφ sψ



∂R232
=
∂φ

−sφ cθ cψ − cφ sψ

0
cφ cθ cψ − sφ sψ
φ

−sφ
0
cφ

[E232 (φ, θ, ψ)]
ψ
0
1
φ
−cφ
0
−sφ
0 0
= 0 0
0 0
0
0
0
cψ
0
−sψ

0
0 
0

0
0 
0
(407)
(408)
(409)
(410)

−sφ sθ

0
cφ sθ
(411)

cφ cθ
−sθ 
sφ c θ
(412)
8.9
Euler Angle Sequence (3,1,2)
R312 (φ, θ, ψ) = R3 (φ)R1 (θ)R2 (ψ) =


cφ cψ + sφ sθ sψ sφ cθ −cφ sψ + sφ sθ cψ
 −sφ cψ + cφ sθ sψ cθ cφ sφ sψ + cφ sθ cψ 
cθ sψ
−sθ
cθ cψ


−ψ
θ 
1
1
φ
L{R312 (φ, θ, ψ)} =  −φ 1
ψ −θ
z
z′′′
z′′, z′
ψ
(413)
y′
θ
φ
y′′
(414)
θ

 

φ312 (R)
atan2 (r12 , r22 )

u312 (R) =  θ312 (R)  =  −asin (r32 )
ψ312 (R)
atan2 (r31 , r33 )
¡

atan2 2q1 q2 + 2q0 q3 ,
¢
2
2
2
2 


¡q2 − q3 + q0¢ − q1 


u312 (Rq (q)) =  −asin¡ 2q2 q3 − 2q0 q1


 atan2 2q1 q3 + 2q0 q2 ,
¢
2
2
2
2
q3 − q2 − q1 + q0
y, y′′′
(415)
x
ψ


cθ sψ
E312 (φ, θ, ψ) =  −sθ
cθ cψ
cψ
0
−sψ

ψ
L{E312 (φ, θ, ψ)} =  −θ
1
1
0
−ψ

0 cφ
0
E312
(φ, θ, ψ) =  0 −sφ
1
0

0
0
L{E312
(φ, θ, ψ)} =  0
1
−1
0
0
cθ
−1

s s
1  φ θ
cθ cφ
=
cθ
sφ
cφ sθ
−sφ cθ
cφ
[E312 (φ, θ, ψ)]
0
[E312
(φ, θ, ψ)]
0
1 
0
(416)
x′′′, x′′
Figure 13: Euler Angle Sequence (3,1,2)

(417)
∂R312
∂θ

0
1 
0

φ
1 
−θ

s
1  ψ
cθ cψ
=
cθ
sθ sψ
x′


sφ cθ
cθ cφ 
−sθ
1
−φ
0
φ

cψ
−cθ sψ 
cψ sθ

cθ
0 
0
(418)
∂R312
=
∂ψ

−cφ sψ + sφ sθ cψ
 sφ sψ + cφ sθ cψ
cθ cψ
(419)
(420)

sφ sψ + cφ sθ cψ
cφ sψ − sφ sθ cψ 
0
(421)
(422)

0 −sφ
0
∂E312
=  0 −cφ
∂φ
0
0

0 0
0
∂E312
= 0 0
∂θ
0 0
(424)
31

sφ cθ cψ
cφ cθ cψ 
−sθ cψ

0 −cφ cψ − sφ sθ sψ
0 sφ cψ − cφ sθ sψ 
0
−cθ sψ

cθ cψ
∂E312
0
=
∂ψ
−cθ sψ

cφ/2 cθ/2 cψ/2 + sφ/2 sθ/2 sψ/2
 cφ/2 cψ/2 sθ/2 + sφ/2 cθ/2 sψ/2 

q312 (φ, θ, ψ) = 
 cφ/2 cθ/2 sψ/2 − sφ/2 cψ/2 sθ/2  (423)
−cφ/2 sθ/2 sψ/2 + cθ/2 cψ/2 sφ/2
cθ cφ
−sφ cθ
0
−sφ sθ
−cφ sθ
−cθ

−sθ sψ
∂E312
=  −cθ
∂θ
−sθ cψ

∂R312
=
∂φ

−sφ cψ + cφ sθ sψ
 −cφ cψ − sφ sθ sψ
0
sφ cθ sψ
=  cφ cθ sψ
−sθ sψ

0 0
0 0 
0 0
(425)
(426)
(427)

0
0 
0
(428)

cθ cφ
−sφ cθ 
0
(429)
−sψ
0
−cψ

−sφ sθ
−cφ sθ 
−cθ
(430)
8.10
Euler Angle Sequence (3,1,3)
R313 (φ, θ, ψ) = R3 (φ)R1 (θ)R3 (ψ) =

cφ cψ − sφ cθ sψ
cφ sψ + sφ cθ cψ
 −sφ cψ − cφ cθ sψ −sφ sψ + cφ cθ cψ
sθ sψ
−sθ cψ

1
L{R313 (φ, θ, ψ)} =  −φ − ψ
0
z, z′′′
z′′, z′
θ

sφ sθ
cφ sθ 
cθ

ψ+φ 0
1
θ 
−θ
1
 

φ313 (R)
atan2 (r13 , r23 )

u313 (R) =  θ313 (R)  =  acos (r33 )
ψ313 (R)
atan2 (r31 , −r32 )
y′
(431)
θ
(432)
y′′′
ψ

¡

atan2 2q1 q3 − 2q0 q2 ¢,


2 q3 + 2q0 q1

¡ 2q
¢
2
2
2
2 

u313 (Rq (q)) =  acos q¡3 − q2 − q1 + q0 
 atan2 2q1 q3 + 2q0 q2 ,

¢
−2q2 q3 + 2q0 q1
y′′
φ
φ
ψ
x
(433)
x′
y
x′′′, x′′


sθ sψ
E313 (φ, θ, ψ) =  −sθ cψ
cθ

0
L{E313 (φ, θ, ψ)} =  −θ
1

−1
[E313 (φ, θ, ψ)]
=
sψ
1 
sθ cψ
sθ
−sψ cθ

−1
0
[E313
(φ, θ, ψ)]
=
−sφ cθ
1 
cφ sθ
sθ
sφ

∂R313
∂θ
0
0 
1
(436)
sφ sθ
cφ sθ 
cθ
(437)
0
θ 
1
(438)
0
0 
sθ
(439)

0 −sφ
0
∂E313
=  0 −cφ
∂φ
0
0
(440)

0 0
0
∂E313
= 0 0
∂θ
0 0
−cφ cθ
−sφ sθ
cφ

sθ
0 
0

cφ/2 cθ/2 cψ/2 − sφ/2 cθ/2 sψ/2
 cφ/2 cψ/2 sθ/2 + sφ/2 sθ/2 sψ/2 

q313 (φ, θ, ψ) = 
 cφ/2 sθ/2 sψ/2 − sφ/2 cψ/2 sθ/2 
cφ/2 cθ/2 sψ/2 + cθ/2 cψ/2 sφ/2

∂R313
=
∂φ

−sφ cψ − cφ cθ sψ
 −cφ cψ + sφ cθ sψ
0
−sφ sψ + cφ cθ cψ
−cφ sψ − sφ cθ cψ
0
(441)

cφ sθ
−sφ sθ  (442)
0
32

sφ cθ
cφ cθ 
−sθ
cφ cψ − sφ cθ sψ
−sφ cψ − cφ cθ sψ
sθ sψ

sθ cψ
∂E313
=  sθ sψ
∂ψ
0

−cψ
sθ sψ
cψ cθ
−sφ sθ cψ
−cφ sθ cψ
−cψ cθ

sψ cθ
∂E313
=  −cψ cθ
∂θ
−sθ

1
−φ
0
sφ sθ sψ
=  cφ sθ sψ
sψ cθ
∂R313
=
∂ψ

−cφ sψ − sφ cθ cψ
 sφ sψ − cφ cθ cψ
sθ cψ
(435)

0 cφ
0
E313
(φ, θ, ψ) =  0 −sφ
1
0
0
0
L{E313
(φ, θ, ψ)} =  0
1
(434)

1
ψ
0



0
0 
1
cψ
sψ
0
Figure 14: Euler Angle Sequence (3,1,3)

0
0 
0

0 0
0 0 
0 0
−sψ
cψ
0

0
0 
0
(443)
(444)
(445)
(446)

cφ sθ
−sφ sθ 
0
(447)

sφ c θ
cφ cθ 
−sθ
(448)
8.11
Euler Angle Sequence (3,2,1)
z
z′′′
R321 (φ, θ, ψ) = R3 (φ)R2 (θ)R1 (ψ) =


cφ cθ sφ cψ + cφ sθ sψ sφ sψ − cφ sθ cψ
 −sφ cθ cφ cψ − sφ sθ sψ cφ sψ + sφ sθ cψ 
sθ
−sψ cθ
cψ cθ

1
φ
L{R321 (φ, θ, ψ)} =  −φ 1
θ −ψ

−θ
ψ 
1
 

φ321 (R)
atan2 (−r21 , r11 )

u321 (R) =  θ321 (R)  =  asin (r31 )
ψ321 (R)
atan2 (−r32 , r33 )
y′
ψ
z′′, z′
θ
(449)
y′′′, y′′
φ
(450)
ψ

¡

atan2 −2q1 q2 + 2q0 q3 ,
¢
2
2
2
2 


¡ q1 + q0 − ¢q3 − q2 


u321 (Rq (q)) =  asin 2q

¡ 1 q3 + 2q0 q2

 atan2 −2q2 q3 + 2q0 q1 ,
¢
2
2
2
2
q3 − q2 − q1 + q0
y
(451)
x, x′′′
θ
φ


sθ
E321 (φ, θ, ψ) =  −sψ cθ
cψ cθ
0
cψ
sψ

θ
L{E321 (φ, θ, ψ)} =  −ψ
1
(452)
Figure 15: Euler Angle Sequence (3,2,1)
1
0 
0

sφ
cφ
0

cφ cθ
−sφ cθ 
sθ
(455)
0
0
L{E321
(φ, θ, ψ)} =  0
1

φ 1
1 −φ 
0 θ
(456)


−1
[E321 (φ, θ, ψ)]
0
1 
0
=
cθ
cθ

−1
0
[E321
(φ, θ, ψ)]
−sψ
cθ cψ
sθ sψ
−cφ sθ
1 
sφ cθ
=
cθ
cφ

cψ
cθ sψ 
−sθ cψ
sφ sθ
cφ cθ
−sφ

−cφ sθ
∂R321
=  sφ sθ
∂θ
cθ
(453)
(454)
0
0
E321
(φ, θ, ψ) =  0
1
x′′

1
0 
0

0
1
ψ
x′

cθ
0 
0

cφ/2 cθ/2 cψ/2 − sφ/2 sθ/2 sψ/2
 cφ/2 cθ/2 sψ/2 + sφ/2 cψ/2 sθ/2 

q321 (φ, θ, ψ) = 
 cφ/2 cψ/2 sθ/2 − sφ/2 cθ/2 sψ/2 
cφ/2 sθ/2 sψ/2 + cθ/2 cψ/2 sφ/2
∂R321
=
∂ψ

0 −sφ sψ + cφ sθ cψ
 0 −cφ sψ − sφ sθ cψ
0
−cθ cψ
cφ cψ − sφ sθ sψ
−sφ cψ − cφ sθ sψ
0
(461)

sφ cψ + cφ sθ sψ
cφ cψ − sφ sθ sψ 
−cθ sψ
(462)

cθ
∂E321
=  sθ sψ
∂θ
−sθ cψ

0
∂E321
=  −cθ cψ
∂ψ
−cθ sψ
(457)

0 cφ
0
∂E321
=  0 −sφ
∂φ
0
0
(458)


∂R321
=
∂φ

−sφ cθ
 −cφ cθ
0

−cφ cθ cψ
sφ cθ cψ 
−sθ cψ
cφ cθ sψ
−sφ cθ sψ
sθ sψ
0
∂E321
∂θ
(459)

cφ sψ + sφ sθ cψ
−sφ sψ + cφ sθ cψ  (460)
0
33
0 0
= 0 0
0 0

0 0
0 0 
0 0
(463)

0
0 
0
(464)

−sφ cθ
−cφ cθ 
0
(465)
0
−sψ
cψ

−cφ sθ
sφ sθ 
cθ
(466)
8.12
Euler Angle Sequence (3,2,3)
R323 (φ, θ, ψ) = R3 (φ)R2 (θ)R3 (ψ) =

cφ cθ cψ − sφ sψ
cφ cθ sψ + sφ cψ
 −sφ cθ cψ − cφ sψ −sφ cθ sψ + cφ cψ
sθ cψ
sθ sψ

1
L{R323 (φ, θ, ψ)} =  −φ − ψ
θ


z, z′′′
z′′, z′

−cφ sθ
sφ sθ  (467)
cθ

ψ + φ −θ
1
0 
0
1

θ
y′
(468)
φ
ψ
x
y′′′, y′′
ψ

φ323 (R)
atan2 (r23 , −r13 )

u323 (R) =  θ323 (R)  =  acos (r33 )
ψ323 (R)
atan2 (r32 , r31 )
¡

atan2 2q2 q3 + 2q0 q1 , ¢


1 q3 + 2q0 q2

¡ −2q
¢
2
2
2
2 

u323 (Rq (q)) =  acos q¡3 − q2 − q1 + q0 
 atan2 2q2 q3 − 2q0 q1 ,

¢
2q1 q3 + 2q0 q2
x′′′
y
θ
(469)
φ


sθ cψ
E323 (φ, θ, ψ) =  sθ sψ
cθ

θ
L{E323 (φ, θ, ψ)} =  0
1

0
0
E323
(φ, θ, ψ) =  0
1
sφ
cφ
0

0
0
L{E323
(φ, θ, ψ)} =  0
1

−1
[E323 (φ, θ, ψ)]
=
cψ
1 
−sθ sψ
sθ
−cψ cθ

−1
0
[E323
(φ, θ, ψ)]
=
c c
1  φ θ
sφ sθ
sθ
−cφ
x′′
(470)
Figure 16: Euler Angle Sequence (3,2,3)


−sψ
cψ
0
0
0 
1
−ψ
1
0

0
0 
1
∂R323
∂θ
(471)


sψ
sθ cψ
−sψ cθ
−sφ cθ
cφ sθ
sφ


0 cφ
0
∂E323
=  0 −sφ
∂φ
0
0
(475)

sθ
0 
0
(476)

0 0
0
∂E323
= 0 0
∂θ
0 0

cφ/2 cθ/2 cψ/2 − sφ/2 cθ/2 sψ/2
 −cφ/2 sθ/2 sψ/2 + sφ/2 cψ/2 sθ/2 

q323 (φ, θ, ψ) = 
 cφ/2 cψ/2 sθ/2 + sφ/2 sθ/2 sψ/2  (477)
cφ/2 cθ/2 sψ/2 + cθ/2 cψ/2 sφ/2

∂R323
=
∂φ

−sφ cθ cψ − cφ sψ
 −cφ cθ cψ + sφ sψ
0
−sφ cθ sψ + cφ cψ
−cφ cθ sψ − sφ cψ
0

sφ sθ
cφ sθ 
0
(478)
34

−cφ cθ
sφ cθ 
−sθ
(479)

0
0 
0
(480)
cφ cθ cψ − sφ sψ
−sφ cθ cψ − cφ sψ
sθ cψ

−sθ sψ
∂E323
=  sθ cψ
∂ψ
0
(474)
0
0 
sθ
−cφ sθ sψ
sφ sθ sψ
cθ sψ

cθ cψ
∂E323
=  cθ sψ
∂θ
−sθ
(473)
φ −θ
1 0 
0 1
−cφ sθ cψ
=  sφ sθ cψ
cθ cψ
∂R323
=
∂ψ

−cφ cθ sψ − sφ cψ
 sφ cθ sψ − cφ cψ
−sθ sψ
(472)
−cφ sθ
sφ sθ 
cθ
x′

0 0
0 0 
0 0
−cψ
−sψ
0

0
0 
0
(481)
(482)

sφ sθ
cφ sθ 
0
(483)

−cφ cθ
sφ c θ 
−sθ
(484)
References
[1] Donald T. Greenwood. Principles of Dynamics, Second
Edition. Prentice Hall, Upper Saddle River, NJ, 1988.
[2] Arend
L.
Schwab.
Quaternions,
finite
rotation
and
euler
parameters.
http://tam.cornell.edu/ als93/quaternion.pdf, 2002.
Cayley-klein parame[3] Eric W. Weisstein.
ters.
From MathWorld–A Wolfram Web Resource.
http://mathworld.wolfram.com/CayleyKleinParameters.html.
[4] Eric W. Weisstein.
Euler angles.
From
MathWorld–A
Wolfram
Web
Resource.
http://mathworld.wolfram.com/EulerAngles.html.
[5] Eric
W.
Weisstein.
Euler
parameters.
From MathWorld–A Wolfram Web Resource.
http://mathworld.wolfram.com/EulerParameters.html.
35