You are on page 1of 35

Representing Attitude: Euler Angles, Unit Quaternions, and Rotation

Vectors
James Diebel
Stanford University
Stanford, California 943019010
Email: diebel@stanford.edu
20 October 2006
Abstract
We present the three main mathematical constructs used to represent the attitude of a rigid body in three-
dimensional 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 benets 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 unied reference on
the whole subject; detailed derivations of some results are not presented.
KeywordsEuler angles, quaternion, Euler-Rodrigues parameters, Cayley-Klein parameters, rotation matrix, di-
rection 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 4
1.1 Overview of Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Coordinate Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 Rotation Matrix 4
2.1 Coordinate Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Transformation Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Pose of a Rigid Body . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.4 Coordinate Rotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.5 Direction Cosine Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.6 Basis Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.7 Rotation Matrix Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3 Kinematics 6
3.1 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.2 Motion of a Fixed Point on a Rigid Body . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.3 Motion of a Particle in a Moving Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4 Finite Dierence Approximations 7
5 Euler Angles 7
5.1 Rotation Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5.2 Euler Angle Rates and Angular Velocity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.3 Linearization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.4 Valid Rotation Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.5 Euler Angle Sequence (3,1,3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.5.1 Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.5.2 Euler Angles Rotation Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.5.3 Euler Angles Rotation Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.5.4 Euler Angles Euler Angle Rates Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.5.5 Euler Angles Unit Quaternion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.5.6 Singularities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.6 Euler Angle Sequence (1,2,3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.6.1 Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.6.2 Euler Angles Rotation Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.6.3 Euler Angles Rotation Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.6.4 Euler Angles Euler Angle Rates Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.6.5 Euler Angles Unit Quaternion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.6.6 Singularities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.7 Derivatives of Selected Trigonometric Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.8 Singularities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.9 Intra-Euler-Angle Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.9.1 Sequence (3,1,3) Sequence (1,2,3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.9.2 Sequence (1,2,3) Sequence (3,1,3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
6 Quaternions 14
6.1 General Quaternions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.2 Quaternion Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.3 Quaternion Quaternion Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.4 Unit Quaternion Rotation Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
6.5 Unit Quaternion Rotation Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
6.6 Quaternion Rates Angular Velocity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
6.7 Quaternion Rates Angular Velocity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
6.8 Quaternion Rates Angular Acceleration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
6.9 Quaternion Rates Angular Acceleration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
6.10 Unit Quaternion Cayley-Klein Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2
6.11 Unit Quaternion Cayley-Klein Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
6.12 Unit Quaternion Axis-Angle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
6.13 Unit Quaternion Axis-Angle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
6.14 Unit Quaternion Euler Angles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
6.15 Unit Quaternion Euler Angles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
6.16 Optimization with Quaternions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
7 Rotation Vector Representation 18
7.1 Rotation Vector Axis-Angle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
7.2 Rotation Vector Axis-Angle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
7.3 Rotation Vector Unit Quaternion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.4 Rotation Vector Unit Quaternion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.5 Rotation Vector Quaternion Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.6 Rotation Vector Quaternion Rates Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
7.7 Rotation Vector Rotation Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
7.8 Rotation Vector Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7.9 Rotation Vector Rates Quaternion Rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7.10 Rotation Vector Rates Angular Velocity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7.11 Rotation Vector Rates Angular Velocity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7.12 Integration of Angular Velocity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
8 A Catalog of Euler Angle Parameterizations 22
8.1 Euler Angle Sequence (1,2,1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
8.2 Euler Angle Sequence (1,2,3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
8.3 Euler Angle Sequence (1,3,1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
8.4 Euler Angle Sequence (1,3,2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
8.5 Euler Angle Sequence (2,1,2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
8.6 Euler Angle Sequence (2,1,3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
8.7 Euler Angle Sequence (2,3,1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
8.8 Euler Angle Sequence (2,3,2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.9 Euler Angle Sequence (3,1,2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
8.10 Euler Angle Sequence (3,1,3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
8.11 Euler Angle Sequence (3,2,1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
8.12 Euler Angle Sequence (3,2,3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3
1 Introduction
This document is intended as a unied reference on the
subject of parameterizing the attitude of an object in three-
dimensional space. It has been written to ll a perceived
gap in the existing on-line literature. In particular, while
there are many web pages and technical reports dedicated
to the subject of Euler angles and quaternions, we were un-
able to nd any single reference that covers all the topics
with a consistent, detailed, and unied treatment. This
problem is exacerbated by the numerous conventions in
current use, and the tendency among authors to assume a
particular convention without explicitly stating their choice,
and without commenting on the alternatives. Further-
more, the existing on-line literature has a particularly large
gap in the area of the various possible choices of Euler an-
gle triples.
The most common way to represent the attitude of a
rigid body is a set of three Euler angles. These are popular
because they are easy to understand and easy to use. Some
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
of Euler angles are: (1) that certain important functions
of Euler angles have singularities, and (2) that they are
less accurate than unit quaternions when used to integrate
incremental changes in attitude over time.
These deciencies in the Euler angle representation have
led researchers to use unit quaternions as a parametriza-
tion of the attitude of a rigid body. The relevant functions
of unit quaternions have no singularities and the represen-
tation is well-suited to integrating the angular velocity of
a body over time. The main disadvantages of using unit
quaternions are: (1) that the four quaternion parameters
do not have intuitive physical meanings, and (2) that a
quaternion must have unity norm to be a pure rotation.
The unity norm constraint, which is quadratic in form, is
particularly problematic if the attitude parameters are to
be included in an optimization, as most standard optimiza-
tion algorithms cannot encode such constraints.
As an alternative to Euler angles and the unit quater-
nion, we oer the rotation vector. The rotation vector
lacks both the singularities of the Euler angles and the
quadratic constraint of the unit quaternion. This is not a
new parametrization, but we have found the existing refer-
ences on this subject to be lacking in detail. The rotation
vector is particularly useful when seeking to optimize over
the attitude parameters in cases in which the Euler angle
singularities cannot be avoided by careful design. It may
not be the best choice in other circumstances.
1.1 Overview of Contents
In Sec. 1.3 we dene the coordinate systems that are used
throughout this report. Sec. 2 introduces the idea of rota-
tion matrices and describes several of their key properties.
Rigid-body kinematics are introduced in Sec. 3. Euler an-
gles are discussed in all their diversity in Sec. 5, including
detailed discussions of the three most commonly-used con-
ventions. Quaternions, especially unit quaternions and the
axis-angle representation, are discussed in Sec. 6. The ro-
tation vector is developed in Sec. 7 as a three-dimensional
parametrization of a quaternion. Finally, a catalog of the
twelve dierent Euler angle parameterizations is presented
in Sec. 8. Throughout this report, conversions between
the various representations, and explanatory notes regard-
ing usage and naming conventions are included where ap-
propriate.
1.2 Sources
The mathematical results in this report have been derived
from basic denitions and rst principles. Several sources
have been used to conrm our results and to provide infor-
mation on the usage of the various conventions. On Euler
angles, we cite [1] and [4]. On Caley-Klein parameters, we
cite [3]. On quaternions and Euler-Rodrigues parameters,
we cite [5] and [2], especially the latter. On Kinematics,
we cite [1].
1.3 Coordinate Systems
We consider the relationships between data expressed in
two dierent coordinate systems:
The world coordinate system is xed in inertial space.
The origin of this coordinate system is denotedx
w
.
The body-xed coordinate system is rigidly attached
to the object whose attitude we would like to de-
scribe. The origin of this coordinate system is de-
noted x
b
.
Points and vectors expressed in the body-xed coordi-
nates are distinguished from those expressed in the world
coordinates by a prime symbol. For example, if x is a
point is the world coordinates, then x

is the same point


expressed in the body-xed coordinates. Needless to say,
x
w
and x

b
are both zero, but x

w
and x
b
are generally not.
Here, x

w
is the origin of the world coordinates expressed
in the body-xed coordinates, and x
b
is the origin of the
body-xed coordinates expressed in the world coordinates.
Some of the mathematics described in this document
only apply when the world coordinate system is rotation-
ally xed. For many purposes, however, it is perfectly ac-
ceptable to consider a slowly-rotating coordinate system,
such as one attached to Earth, to be a valid world coordi-
nate system, despite its non-zero angular velocity.
2 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 33 rotation matrices is
denoted by SO(3). Thus, if R SO(3), then
det R = 1 and R
1
= R
T
. (1)
4
Rotation matrices for which det R = 1 are called proper
and those for which det R = 1 are called improper. Im-
proper rotations are also known as rotoinversions, and con-
sist of a rotation followed by an inversion operation. We
restrict our analysis to proper rotations, as improper rota-
tions are not rigid-body transformations.
We reference the elements of a rotation matrix as fol-
lows:
R =
_
r
1
r
2
r
3

(2)
=
_
_
r
11
r
12
r
13
r
21
r
22
r
23
r
31
r
32
r
33
_
_
. (3)
There are two possible conventions for dening the ro-
tation matrix that encodes the attitude of a rigid body
and both are in current use. Some authors prefer to write
the matrix that maps from the body-xed coordinates to
the world coordinates; others prefer the matrix that maps
from the world coordinates to the body-xed coordinates.
Though converting between the two conventions is as
trivial as performing the transpose of a matrix, it is nec-
essary to be sure that two dierent sources are using the
same convention before using results from both sources to-
gether. Indeed, one of the motivations of this report is to
provide a single coherent reference that covers the entire
subject.
2.1 Coordinate Transformations
We dene the rotation matrix that encodes the attitude of
a rigid body to be the matrix that when pre-multiplied by
a vector expressed in the world coordinates yields the same
vector expressed in the body-xed coordinates. That is, if
z R
3
is a vector in the world coordinates and z

R
3
is
the same vector expressed in the body-xed coordinates,
then the following relations hold:
z

= Rz (4)
z = R
T
z

. (5)
These expression apply to vectors, relative quantities lack-
ing a position in space. To transform a point from one
coordinate system to the other we must subtract the oset
to the origin of the target coordinate system before apply-
ing the rotation matrix. Thus, if x R
3
is a point in the
world coordinates and x

R
3
is the same point expressed
in the body-xed coordinates, then we may write
x

= R (x x
b
) = Rx +x

w
(6)
x = R
T
(x

w
) = R
T
x

+x
b
. (7)
Substituting x = 0 into Eq. 6 and x

= 0 into Eq. 7 yields


x

w
= Rx
b
(8)
x
b
= R
T
x

w
. (9)
2.2 Transformation Matrix
It is quite common in the computer graphics community
to write Eqs. 6 and 7 as matrix-vector products:
_
x

1
_
=
_
R x

w
0
T
1
_ _
x
1
_
(10)
=
_
R Rx
b
0
T
1
_ _
x
1
_
(11)
_
x
1
_
=
_
R
T
x
b
0
T
1
_ _
x

1
_
(12)
=
_
R
T
R
T
x

w
0
T
1
_ _
x

1
_
. (13)
The substantial popularity of this convention is probably
due to its adoption by the manufacturers of 3D-accelerated
graphics hardware.
2.3 Pose of a Rigid Body
The pose of a rigid body is the position and attitude of
that body. The bulk of this report deals with parameteri-
zations of attitude. The position is most naturally encoded
by x
b
, the position of the origin of the body-xed coordi-
nates as expressed in world coordinates. It is, however,
equally valid to store x

w
, the position of the origin of the
world coordinates as expressed in the body-xed coordi-
nates. The two are related to one another through the
attitude of the body, according to Eqs. 8 and 9.
2.4 Coordinate Rotations
A coordinate rotation is a rotation about a single coordi-
nate axis. Enumerating the x-, y-, and z-axes with 1,2,
and 3, the coordinate rotations, R
i
: R SO(3), for
i {1, 2, 3}, are
R
1
() =
_
_
1 0 0
0 cos () sin()
0 sin() cos ()
_
_
(14)
R
2
() =
_
_
cos () 0 sin()
0 1 0
sin() 0 cos ()
_
_
(15)
R
3
() =
_
_
cos () sin() 0
sin() cos () 0
0 0 1
_
_
. (16)
A sample rotation of this form is illustrated in Fig. 1,
which shows a rotation about the z-axis by an angle .
2.5 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-xed axes
and the world axes. Denoting the world axes by (x, y, z)
5
[x
1
y
1
0]
T
= R
3
() [x
1
y
1
0]
T
x
1
y
1
z, z
x
y
x
1
y
1
x
y

Figure 1: A sample coordinate rotation about the z-axis


by an angle .
and the body-xed axes by (x

, y

, z

), let
x

,y
be, for ex-
ample, the unsigned angle between the x

-axis and the y-


axis. In terms of these angles, the rotation matrix may be
written
R =
_
_
cos(
x

,x
) cos(
x

,y
) cos(
x

,z
)
cos(
y

,x
) cos(
y

,y
) cos(
y

,z
)
cos(
z

,x
) cos(
z

,y
) cos(
z

,z
)
_
_
. (17)
To illustrate this with a concrete example, consider the case
shown in Fig. 1. Here,
x

,x
=
y

,y
= ,
x

,y
=

2
,

,x
=

2
+ ,
z

,z
= 0, and
z

,{x,y}
=
{x

,y

},z
=

2
.
Expanding Eq. 17,
R =
_
_
cos(
x

,x
) cos(
x

,y
) 0
cos(
y

,x
) cos(
y

,y
) 0
0 0 1
_
_
=
_
_
cos() cos(

2
) 0
cos(

2
+ ) cos() 0
0 0 1
_
_
=
_
_
cos() sin() 0
sin() cos() 0
0 0 1
_
_
. (18)
This is the same result that is presented in Eq. 16 in Sec.
2.4.
2.6 Basis Vectors
The rotation matrix may also be thought of as the ma-
trix of basis vectors that dene the world and body-xed
coordinate systems. The rows of the rotation matrix are
the basis vectors of the body-xed coordinates expressed
in world coordinates, and the columns are the basis vec-
tors of the world coordinates expressed in the body-xed
coordinates.
2.7 Rotation Matrix Multiplication
The multiplication of two rotation matrices yields another
rotation matrix whose application to a point eects the
same rotation as the sequential application of the two orig-
inal rotation matrices. For example, let
z

= R
a
z (19)
z

= R
b/a
z

= R
b/a
R
a
z = R
b
z, (20)
where
R
b
= R
b/a
R
a
. (21)
Note that the rotations are applied in the reverse order.
That is, here we apply R
a
rst, followed by R
b/a
.
3 Kinematics
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.
3.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 dene the relevant terms here.
All of these quantities may be expressed in either the
world coordinates or the body-xed coordinates, whichever
is more convenient. Body-xed 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 dened here are vector quantities,
except x
p
and x
b
, which are points.
x
b
, x
b
, and x
b
are the position, velocity, and acceler-
ation of b.
x
p
, x
p
, and x
p
are the position, velocity, and accel-
eration of p.
x
p/b
, x
p/b
, and x
p/b
are the position, velocity, and
acceleration of p relative to b (i.e., as seen by an ob-
server rigidly attached to b).
and are the angular velocity and angular accel-
eration of b.
R is the rotation matrix of b, whose application is
illustrated in Eqs. 4-7.
Given these denitions, we consider two main cases.
The rst deals with a point rigidly attached to the body,
and the second deals with a particle moving with respect
to it.
6
3.2 Motion of a Fixed Point on a Rigid
Body
Let p be rigidly attached to the body, b, such that x
p/b
=
x
p/b
= 0. The velocity of the point, p, is then
x
p
= x
b
+x
p/b
= x
b
+ C() x
p/b
, (22)
where the skew-symmetric cross product matrix function
C : R
3
R
33
is dened by
C() =
_
_
0
3

2

3
0
1

2

1
0
_
_
. (23)
Alternatively, we may express the velocity in more conve-
nient terms by using a combination of world and body-xed
terms:
x
p
= x
b
+ R
T
_

p/b
_
= x
b
+ R
T
C(

) x

p/b
. (24)
The acceleration of p is
x
p
= x
b
+ x
p/b
+
_
x
p/b
_
= x
b
+
_
C( ) + C()
2

x
p/b
, (25)
or, using a combination of world and body-xed terms:
x
p
= x
b
+ R
T
_

p/b
+

p/b
__
= x
b
+ R
T
_
C(

) + C(

)
2

p/b
, (26)
where
C()
2
=
_
_

3
2

2
2

1

3

1

3
2

1
2

1

3

2

2
2

1
2
_
_
. (27)
3.3 Motion of a Particle in a Moving Frame
Next, we consider the case in which the point is not rigidly
attached to the body, but is a particle moving relative to
it. The velocity of the particle in the world frame is
x
p
= x
b
+ x
p/b
+x
p/b
= x
b
+ R
T
_
x

p/b
+

p/b
_
= x
b
+ R
T
_
x

p/b
+ C(

) x

p/b
_
, (28)
and the acceleration is
x
p
= x
b
+
angular
..
x
p/b
+
centripetal
..

_
x
p/b
_
+ x
p/b
+ 2 x
p/b
. .
Coriolis
. (29)
Again, we may recongure this to yield a more useful nal
expression:
x
p
= x
b
+ R
T
_
_
C(

) + C(

)
2

p/b
+ x

p/b
+ 2C(

) x

p/b
_
. (30)
From these results, it can be seen that Eqs. 28-30 are strict
generalizations of Eqs. 22 and 24 and Eqs. 25 and 26.
4 Finite Dierence Approximations
At several points in this paper the angular velocity of a
rigid body is related to the time derivative of the the atti-
tude parameters. In many applications, it is necessary to
approximate these time derivatives using nite dierence
approximations. In this section, the most common and
useful nite dierence approximations are presented and
discussed.
We will discuss a general time-varying vector quantity,
z (t) R
n
. Finite dierence approximations are denoted
with the operator
n
S,h
, where n is the order of the deriva-
tive, S is the stencil over which the nite dierence ap-
proximation is computed, and h is the size of the time in-
crement between samples. Finite dierence operators are
linear combinations of function evaluations in the neigh-
borhood of the evaluation point. A general nite dierence
approximation is written

n
S,h
z (t
0
) =
1
h
n

kS
a
k
z (t
0
+ kh)
=
1
c h
n

kS
b
k
z (t
0
+ kh) , (31)
where {a
k
Q|k S} is the set nite dierence coecients
for which c Z and {b
k
Z|k S} are a convenient ratio-
nal decomposition. The actual derivative of the function
is
z
(n)
(t
0
) =
n
S,h
z (t
0
) + d h
m
z
(n+m)
() , (32)
where m is called the order of accuracy, and [t
0
h, t
0
+
h] is some unknown evaluation point for the truncation
error term.
The error is not typically calculated, but m indicates
how the error depends on the step size, h. For exam-
ple, halving the step size produces a fourfold improvement
in accuracy for second-order accurate methods but only a
twofold improvement for rst-order accurate methods.
Tables 1 and 2 show the nite dierence coecients for
various stencils and orders.
5 Euler Angles
5.1 Rotation Sequence
Three coordinate rotations in sequence can describe any
rotation. Let us consider triple rotations in which the rst
7
Table 1: Finite dierence coecients over a symmetric
seven-point stencil.
k
m c -3 -2 -1 0 1 2 3 d
First Derivative (b
k
)
1 1 -1 1 1/2
1 1 -1 1 -1/2
2 2 1 -4 3 1/3
2 2 -1 0 1 -1/6
2 2 -3 4 -1 1/3
3 6 -2 9 -18 11 1/4
3 6 1 -6 3 2 -1/12
3 6 -2 -3 6 -1 1/12
3 6 -11 18 -9 2 -1/4
4 12 -1 6 -18 10 3 -1/20
4 12 1 -8 0 8 -1 1/30
4 12 -3 -10 18 -6 1 -1/20
5 60 -2 15 -60 20 30 -3 1/60
5 60 3 -30 -20 60 -15 2 -1/60
6 60 -1 9 -45 0 45 -9 1 -1/140
Second Derivative (b
k
)
1 1 1 -2 1 1
1 1 1 -2 1 -1
2 1 -1 4 -5 2 11/12
2 1 1 -2 1 -1/12
2 1 2 -5 4 -1 11/12
3 12 -1 4 6 -20 11 -1/12
3 12 11 -20 6 4 -1 1/12
4 12 -1 16 -30 16 -1 1/90
6 180 2 -27 270 -490 270 -27 2 -1/560
Third Derivative (b
k
)
1 1 -1 3 -3 1 3/2
1 1 -1 3 -3 1 1/2
1 1 -1 3 -3 1 -1/2
1 1 -1 3 -3 1 -3/2
2 2 1 -6 12 -10 3 1/4
2 2 -1 2 0 -2 1 -1/4
2 2 -3 10 -12 6 -1 1/4
3 4 1 -7 14 -10 1 1 -1/8
3 4 -1 -1 10 -14 7 -1 1/8
4 8 1 -8 13 0 -13 8 -1 7/120
Fourth Derivative (b
k
)
1 1 1 -4 6 -4 1 1
1 1 1 -4 6 -4 1 -1
2 1 1 -4 6 -4 1 -1/6
4 6 -1 12 -39 56 -39 12 -1 7/240
Fifth Derivative (b
k
)
1 1 -1 5 -10 10 -5 1 1/2
1 1 -1 5 -10 10 -5 1 -1/2
2 2 -1 4 -5 0 5 -4 1 -1/3
Sixth Derivative (b
k
)
2 1 1 -6 15 -20 15 -6 1 -1/4
Table 2: Finite dierence coecients over a one-sided
seven-point stencil.
k
m c 0 1 2 3 4 5 6 d
First Derivative (b
k
)
1 1 -1 1 -1/2
2 2 -3 4 -1 1/3
3 6 -11 18 -9 2 -1/4
4 12 -25 48 -36 16 -3 1/5
5 60 -137 300 -300 200 -75 12 -1/6
6 60 -147 360 -450 400 -225 72 -10 1/7
Second Derivative (b
k
)
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 (b
k
)
1 1 -1 3 -3 1 -3/2
2 2 -5 18 -24 14 -3 7/4
3 4 -17 71 -118 98 -41 7 -15/8
4 8 -49 232 -461 496 -307 104 -15 29/15
Fourth Derivative (b
k
)
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 (b
k
)
1 1 -1 5 -10 10 -5 1 -5/2
2 2 -7 40 -95 120 -85 32 -5 25/6
Sixth Derivative (b
k
)
1 1 1 -6 15 -20 15 -6 1 -3
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, dened by
u := [, , ]
T
. (33)
The function that maps an Euler angle vector to its
corresponding rotation matrix, R
ijk
: R
3
SO(3), is
R
ijk
(, , ) := R
i
()R
j
()R
k
(). (34)
As in the general case, if z R
3
is a vector in the world
coordinates and z

R
3
is the same vector expressed in the
body-xed coordinates, then the following relations hold:
z

= R
ijk
(u) z (35)
z = R
ijk
(u)
T
z

. (36)
5.2 Euler Angle Rates and Angular Veloc-
ity
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 veloc-
ity in the global coordinates. Letting e
i
be the i
th
unit
vector, the function that maps an Euler angle vector to its
corresponding Euler angle rates matrix, E : R
3
R
3x3
, is
E
ijk
(, , ) :=
_
R
k
()
T
R
j
()
T
e
i
, R
k
()
T
e
j
, e
k

, (37)
and the related conjugate Euler angle rates matrix func-
tion, E

: R
3
R
3x3
, whose multiplication with the vector
of Euler angle rates yields the body-xed angular velocity
is
E

ijk
(, , ) := [ e
i
, R
i
() e
j
, R
i
()R
j
() e
k
] . (38)
Hence,
= E
ijk
(u) u (39)

= E

ijk
(u) u. (40)
Noting also that the angular velocity in the body-xed
coordinates may be related to the angular velocity in the
global coordinates by

= R
ijk
(u) (41)
= R
ijk
(u)
T

, (42)
we may eliminate ,

, and u to yield
R
ijk
(u) = E

ijk
(u) [E
ijk
(u)]
1
(43)
R
ijk
(u)
T
= E
ijk
(u)
_
E

ijk
(u)

1
. (44)
0 5 10 15 20 25 30
0
2
4
6
8
10
12
14
16
Angle, [degrees]
R
e
l
a
t
i
v
e

E
r
r
o
r

[
%
]
( sin())/sin()
(1 cos())/cos()
Figure 2: Error in the linearized approximations to the
sine and cosine as a function of the input angle.
5.3 Linearization
Many applications require linear equations. Functions of
Euler angles depend on trigonometric primitives such as
the sine and cosine. As a consequence, it is useful to con-
sider the linearized versions of these functions.
We consider the case of linearizing about zero. In this
context, linearization involves substituting:
cos() 1 (45)
sin() . (46)
Higher order terms are then set to zero. These substitu-
tions 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 ap-
proximation to the sine at an angle of 14

; for the cosine,


the same error is reached at an angle of 8.2

. Typically,
these approximations are considered valid for angles less
than 10

.
We denote the linearization operation by L. For ex-
ample, the linearized version of the function R
ijk
(u) is
L{R
ijk
(u)}. In Sec. 8 we include the linearized versions
of several key functions in the exposition of each valid ro-
tation sequence.
Linearizing about an attitude other than zero is most
easily accomplished by considering small perturbations about
a xed attitude. Let u
0
be the set of Euler angles about
which we would like to linearize and let u be the vector of
perturbation angles. We write
R
u
0
(u) = L{R
ijk
(u)} R
ijk
(u
0
). (47)
Here, we are considering u
0
to be constant, such that the
product of the two rotation matrices is still linear in the
parameters of u.
5.4 Valid Rotation Sequences
Thus far, we have not specied what sequences of coordi-
nate rotations are able to span the space of all three di-
9
Table 3: Corresponding quantities between the three most
common Euler angle conventions.
Rotation Sequence
(1,2,3) (3,1,3) (3,2,3)


2


2


x y x
y x y
z z z
x

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)
_
. (48)
The three in bold, (1, 2, 3), (3, 1, 3), and (3, 2, 3), are the
most common choices. These three conventions are con-
trasted in Table 3 and the rst two are discussed presently.
5.5 Euler Angle Sequence (3,1,3)
5.5.1 Usage
The most common sequence associated with the name Eu-
ler angles is (3, 1, 3), named for Leonhard Euler, an 18th-
century Swiss mathematician and physicist. To disam-
biguate it from the other conventions that share the same
name, it is also known as the x-convention.
In the study of the gyroscopic motion of a spinning rigid
body, the Euler angles, , , and , are known respectively
as spin, nutation, and precession.
A commonplace example of gyroscopic motion is a spin-
ning top. In this case, the body-xed z-axis is aligned
with the spin-axis of the top, and the body-xed x- and
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
moment arising from this tilt produces the familiar slow
orbiting motion, called precession.
5.5.2 Euler Angles Rotation Matrix
For compact notation in this and subsequent sections, we
write c

:= cos(), s

:= sin(), etc. The function that


maps a vector of Euler angles to its rotation matrix, and
that same function linearized, are
R
313
(, , ) = R
3
()R
1
()R
3
() =
_
_
c

+ s

+ c

_
_
(49)
L{R
313
(, , )} =
_
_
1 + 0
1
0 1
_
_
. (50)
The derivatives of the rotation matrix with respect to the
Euler angles are
R
313

=
_
_
s

+ c

+ s

0 0 0
_
_
(51)
R
313

=
_
_
s

_
_
(52)
R
313

=
_
_
c

0
s

0
s

0
_
_
. (53)
5.5.3 Euler Angles Rotation Matrix
The inverse mapping, which gives the Euler angles as a
function of the rotation matrix, and the composition of
that function with the rotation matrix as a function of the
unit quaternion, are
u
313
(R) =
_
_

313
(R)

313
(R)

313
(R)
_
_
=
_
_
atan2 (r
13
, r
23
)
acos (r
33
)
atan2 (r
31
, r
32
)
_
_
(54)
u
313
(R
q
(q)) =
_

_
atan2
_
2q
1
q
3
2q
0
q
2
,
2q
2
q
3
+ 2q
0
q
1
_
acos
_
q
3
2
q
2
2
q
1
2
+ q
0
2
_
atan2
_
2q
1
q
3
+ 2q
0
q
2
,
2q
2
q
3
+ 2q
0
q
1
_
_

_
(55)
5.5.4 Euler Angles Euler Angle Rates Matrices
The Euler angle rates matrices as a function of the Euler
angles, their linearized equivalents, and their inverses, are
E
313
(, , ) =
_
_
s

0
s

0
c

0 1
_
_
(56)
L{E
313
(, , )} =
_
_
0 1 0
0
1 0 1
_
_
(57)
[E
313
(, , )]
1
=
1
s

_
_
s

0
s

0
s

_
_
(58)
10
y
y
y
y

x
z, z

x, x

z, z
x
Figure 3: Euler Angle Sequence (3,1,3)
E

313
(, , ) =
_
_
0 c

0 s

1 0 c

_
_
(59)
L{E

313
(, , )} =
_
_
0 1 0
0
1 0 1
_
_
(60)
[E

313
(, , )]
1
=
1
s

_
_
s

0
s

0
_
_
. (61)
The derivatives of the Euler angle rates matrices with re-
spect to the Euler angles are
E
313

=
_
_
c

0 0
c

0 0
s

0 0
_
_
(62)
E
313

=
_
_
s

0
s

0
0 0 0
_
_
(63)
E

313

=
_
_
0 s

0 c

0 0 0
_
_
(64)
E

313

=
_
_
0 0 s

0 0 c

0 0 s

_
_
. (65)
5.5.5 Euler Angles Unit Quaternion
The function that maps Euler angles to their corresponding
unit quaternion is
q
313
(, , ) =
_

_
c
/2
c
/2
c
/2
s
/2
c
/2
s
/2
c
/2
c
/2
s
/2
+ s
/2
s
/2
s
/2
c
/2
s
/2
s
/2
s
/2
c
/2
s
/2
c
/2
c
/2
s
/2
+ c
/2
c
/2
s
/2
_

_
. (66)
5.5.6 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 coecient is
1/ sin().
It is a notable characteristic of this parametrization,
and all parameterizations of the form (i, j, i), that there ex-
ists a singularity at the home position, [, , ] = [0, 0, 0].
This and other singularities are discussed further in Sec.
5.8.
5.6 Euler Angle Sequence (1,2,3)
5.6.1 Usage
The angles associated with the sequence (1, 2, 3) are some-
times 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 an-
gles are also commonly referred to simply as Euler angles
in the aeronautics eld, 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 di-
rection is along the positive body-xed x-axis, with the
body-xed y-axis to starboard, and the body-xed z-axis
downward. In such a conguration, the home position,
[, , ] = [0, 0, 0], is at 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 pitch-
ing upward. A less common standard using the same se-
quence is to have the y-axis point to port and the z-axis
point upward. In this case, a positive change in corre-
sponds 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
R
123
(, , ) = R
1
()R
2
()R
3
() =
_
_
c

+ c

+ s

_
_
(67)
L{R
123
(, , )} =
_
_
1
1
1
_
_
. (68)
11
y, y
y
y

z, z

x, x
x

z
x
Figure 4: Euler Angle Sequence (1,2,3)
The derivatives of the rotation matrix with respect to the
Euler angles are
R
123

=
_
_
0 0 0
c

+ s

+ c

_
_
(69)
R
123

=
_
_
c

_
_
(70)
R
123

=
_
_
c

0
s

0
c

+ s

+ s

0
_
_
. (71)
5.6.3 Euler Angles Rotation Matrix
The inverse mapping, which gives the Euler angles as a
function of the rotation matrix, and the composition of
that function with the rotation matrix as a function of the
unit quaternion, are
u
123
(R) =
_
_

123
(R)

123
(R)

123
(R)
_
_
=
_
_
atan2 (r
23
, r
33
)
asin(r
13
)
atan2 (r
12
, r
11
)
_
_
(72)
u
123
(R
q
(q)) =
_

_
atan2
_
2q
2
q
3
+ 2q
0
q
1
,
q
3
2
q
2
2
q
1
2
+ q
0
2
_
asin
_
2q
1
q
3
2q
0
q
2
_
atan2
_
2q
1
q
2
+ 2q
0
q
3
,
q
1
2
+ q
0
2
q
3
2
q
2
2
_
_

_
(73)
5.6.4 Euler Angles Euler Angle Rates Matrices
The Euler angle rates matrices as a function of the Euler
angles, their linearized equivalents, and their inverses, are
E
123
(, , ) =
_
_
c

0
c

0
s

0 1
_
_
(74)
L{E
123
(, , )} =
_
_
1 0
1 0
0 1
_
_
(75)
[E
123
(, , )]
1
=
1
c

_
_
c

0
c

0
c

_
_
(76)
E

123
(, , ) =
_
_
1 0 s

0 c

0 s

_
_
(77)
L{E

123
(, , )} =
_
_
1 0
0 1
0 1
_
_
(78)
[E

123
(, , )]
1
=
1
c

_
_
c

0 c

0 s

_
_
. (79)
The derivatives of the Euler angle rates matrices with re-
spect to the Euler angles are
E
123

=
_
_
c

0 0
s

0 0
c

0 0
_
_
(80)
E
123

=
_
_
c

0
c

0
0 0 0
_
_
(81)
E

123

=
_
_
0 0 0
0 s

0 c

_
_
(82)
E

123

=
_
_
0 0 c

0 0 s

0 0 c

_
_
. (83)
5.6.5 Euler Angles Unit Quaternion
The function that maps Euler angles to their corresponding
unit quaternion is
q
123
(, , ) =
_

_
c
/2
c
/2
c
/2
+ s
/2
s
/2
s
/2
c
/2
s
/2
s
/2
+ c
/2
c
/2
s
/2
c
/2
c
/2
s
/2
+ s
/2
c
/2
s
/2
c
/2
c
/2
s
/2
s
/2
c
/2
s
/2
_

_
. (84)
12
5.6.6 Singularities
This parametrization has singularities at pitch values of
=

2
+ n, for n Z. It is thus only suitable for de-
scribing vehicles that do not perform vertical or inverted
maneuvers, such as land vehicles, boats and ships, and
transport aircraft.
All Euler angle sequences that do not have a repeated
axis of rotation have this singularity. See Sec. 5.8 for
further details on this and other singularities.
5.7 Derivatives of Selected Trigonometric
Functions
Throughout this report we use various trigonometric func-
tions. The derivatives of most of these will be familiar to
the reader, but three of them warrant mention. The four-
quadrant inverse tangent, atan2 : RR [, ], and its
derivatives are
atan2(y, x) =
_
_
_
atan(y/x) if x > 0
atan(y/x) if x < 0 y < 0
atan(y/x) + if x < 0 y > 0
(85)
atan2(y, x)
x
=
y
x
2
+ y
2
(86)
atan2(y, x)
y
=
x
x
2
+ y
2
. (87)
The derivatives of the inverse sine and inverse cosine are
dasin(x)
dx
=
1

1 x
2
(88)
dacos(x)
dx
=
1

1 x
2
. (89)
5.8 Singularities
The singularities found in the various Euler angle represen-
tations are said to arise from gimbal lock. Two examples
of this phenomenon are presented in Secs. 5.5.6 and 5.6.6.
Gimbal lock may be understood in several dierent
ways. Intuitively, it arises from the indistinguishability of
changes in the rst 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 in-
distinguishable. 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
r
23
= r
33
= r
12
= r
11
= 0, and the expressions for
123
(R)
and
123
(R) in Eq. 73 are undened. A similar conse-
quence may be observed in the case of the (3, 1, 3) sequence
when sin() = 0. This eect is even more obvious in Eqs.
56 and 74, where the singularity may be seen directly in
the leading coecient.
A common strategy for dealing with this problem is to
change representations whenever an object nears a singu-
larity. Even more popular is the use of unit quaternions to
represent an objects attitude. Using unit quaternions to
represent the attitude of an object completely avoids the
problem of gimbal lock. Unit quaternions also have several
other notable advantages that will be discussed in Sec. 6.
The main disadvantage of unit quaternions, however, is
that they are constrained to have unit length, a constraint,
that while inconsequential in many cases, can lead to com-
plications when attempting to optimize over the quater-
nion parameters. This is due to the fact that a unity norm
constraint is quadratic in form and thus impossible to in-
clude in most standard optimization techniques.
5.9 Intra-Euler-Angle Conversion
Converting between representations is sometimes necessary
to avoid gimbal lock. In this section, the conversions be-
tween (3, 1, 3) sequence and the (1, 2, 3) sequence are pro-
vided, along with Jacobians required for ltering applica-
tions.
5.9.1 Sequence (3,1,3) Sequence (1,2,3)
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
u
123
313
(, , ) = u
313
(R
123
(, , ))
=
_
_
atan2 (s

, s

)
acos (c

)
atan2 (c

+ s

, c

+ s

)
_
_
(90)
The Jacobian of this function with respect to the (1, 2, 3)
Euler angles is
u
123
313
u
=
_
u
123
313

u
123
313

u
123
313

_
=
1
a
_
_
c

as

ac

0
s

a
_
_
(91)
where
a := 1 c
2

c
2

(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
u
313
123
(, , ) = u
123
(R
313
(, , ))
=
_
_
atan2 (c

, c

)
asin(s

)
atan2 (c

+ s

, c

)
_
_
(93)
13
The Jacobian of this function with respect to the (3, 1, 3)
Euler angles is
u
313
123
u
=
_
u
313
123

u
313
123

u
313
123

_
=
_

1
a
s

1
a
c

_
c
2

+ s
2

_
0

b
c

b
s

0
1
c
c

_
s
2

+ c
2

_

1
c
c

1
_

_ (94)
where
a := c
2

+ c
2

s
2

b := 1 s
2

s
2

(95)
c := s
2

c
2

+ c
2

(96)
are repeating terms that have been factored for notational
and computational ease.
6 Quaternions
Quaternions were rst devised by William Rowan Hamil-
ton, a 19th-century Irish mathematician. There is a sub-
stantial body of quaternion mathematics that are beyond
the scope of this report. Consequently, we focus on the
essential denitions required to use the quaternion as a
representation of the attitude of an object.
6.1 General Quaternions
A quaternion, q H, may be represented as a vector,
q = [q
0
, q
1
, q
2
, q
3
]
T
=
_
q
0
q
1:3
_
, (97)
along with a set of additional denitions and operations
that may be applied to it. The adjoint, norm, and inverse
of the quaternion, q, are
q =
_
q
0
q
1:3
_
(98)
q =
_
q
2
0
+ q
2
1
+ q
2
2
+ q
2
3
(99)
q
1
=
q
q
. (100)
6.2 Quaternion Multiplication
Quaternion multiplication is not commutative. Quaternion
multiplication between quaternions q and p is dened by
q p = q
m
(q, p) (101)
=
_
q
0
p
0
q
T
1:3
p
1:3
q
0
p
1:3
+ p
0
q
1:3
q
1:3
p
1:3
_
(102)
=
_
q
0
q
T
1:3
q
1:3
q
0
I
3
C(q
1:3
)
_ _
p
0
p
1:3
_
(103)
=
_
p
0
p
T
1:3
p
1:3
p
0
I
3
+ C(p
1:3
)
_ _
q
0
q
1:3
_
, (104)
where the skew-symmetric cross product matrix function
C : R
3
R
33
is dened by
C(x) =
_
_
0 x
3
x
2
x
3
0 x
1
x
2
x
1
0
_
_
. (105)
6.3 Quaternion Quaternion Matrices
More compactly, quaternion multiplication may be written
as the second quaternion pre-multiplied by a matrix-valued
function of the rst quaternion. That is,
q p = q
m
(q, p) = Q(q)p =

Q(p)q (106)
p q = q
m
(p, q) = Q(p)q =

Q(q)p, (107)
where the quaternion matrix function, Q : H R
44
is
dened by
Q(q) =
_
q
0
q
T
1:3
q
1:3
q
0
I
3
+ C(q
1:3
)
_
(108)
=
_

_
q
0
q
1
q
2
q
3
q
1
q
0
q
3
q
2
q
2
q
3
q
0
q
1
q
3
q
2
q
1
q
0
_

_, (109)
and the the closely related conjugate quaternion matrix
function,

Q : H R
44
is dened by

Q(q) =
_
q
0
q
T
1:3
q
1:3
q
0
I
3
C(q
1:3
)
_
(110)
=
_

_
q
0
q
1
q
2
q
3
q
1
q
0
q
3
q
2
q
2
q
3
q
0
q
1
q
3
q
2
q
1
q
0
_

_. (111)
Substituting Eq. 98 into Eqs. 108 and 110 yields
Q( q) = Q(q)
T
(112)

Q( q) =

Q(q)
T
. (113)
The derivatives of the quaternion multiplication function
are
q
m
(q, p)
q
=

Q(p) (114)
q
m
(q, p)
p
= Q(q). (115)
The derivatives of the quaternion matrix functions with
respect to the parameters of the quaternion are
Q
q
0
=
_

_
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
_

_,
Q
q
1
=
_

_
0 1 0 0
1 0 0 0
0 0 0 1
0 0 1 0
_

_, (116)
Q
q
2
=
_

_
0 0 1 0
0 0 0 1
1 0 0 0
0 1 0 0
_

_,
Q
q
3
=
_

_
0 0 0 1
0 0 1 0
0 1 0 0
1 0 0 0
_

_. (117)
14


Q
q
0
=
_

_
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
_

_,


Q
q
1
=
_

_
0 1 0 0
1 0 0 0
0 0 0 1
0 0 1 0
_

_, (118)


Q
q
2
=
_

_
0 0 1 0
0 0 0 1
1 0 0 0
0 1 0 0
_

_,


Q
q
3
=
_

_
0 0 0 1
0 0 1 0
0 1 0 0
1 0 0 0
_

_. (119)
6.4 Unit Quaternion Rotation Matrix
Unit quaternions are quaternions with unity norm. Through-
out this section, we assume that
q = 1. (120)
A unit quaternion can be used to represent the attitude
of a rigid body. Consider a vector z R
3
in the global
coordinates. If z

R
3
is the same vector in the body-
xed coordinates, then the following relations hold:
_
0
z

_
= q
_
0
z
_
q
1
(121)
= q
_
0
z
_
q (122)
=

Q(q)
T
Q(q)
_
0
z
_
(123)
=
_
1 0
T
0 R
q
(q)
_ _
0
z
_
, (124)
where
R
q
(q) = (125)
_
_
q
2
0
+ q
2
1
q
2
2
q
2
3
2q
1
q
2
+ 2q
0
q
3
2q
1
q
3
2q
0
q
2
2q
1
q
2
2q
0
q
3
q
2
0
q
2
1
+ q
2
2
q
2
3
2q
2
q
3
+ 2q
0
q
1
2q
1
q
3
+ 2q
0
q
2
2q
2
q
3
2q
0
q
1
q
2
0
q
2
1
q
2
2
+ q
2
3
_
_
.
That is,
z

= R
q
(q)z (126)
z = R
q
(q)
T
z

. (127)
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
R
q
(q p) = R
q
(q)R
q
(p). (128)
The derivatives of the rotation matrix function with re-
spect to the quaternion parameters are
R
q
q
0
= 2
_
_
q
0
q
3
q
2
q
3
q
0
q
1
q
2
q
1
q
0
_
_
,
R
q
q
1
= 2
_
_
q
1
q
2
q
3
q
2
q
1
q
0
q
3
q
0
q
1
_
_
, (129)
R
q
q
2
= 2
_
_
q
2
q
1
q
0
q
1
q
2
q
3
q
0
q
3
q
2
_
_
,
R
q
q
3
= 2
_
_
q
3
q
0
q
1
q
0
q
3
q
2
q
1
q
2
q
3
_
_
. (130)
6.5 Unit Quaternion Rotation Matrix
The reverse mapping, from a rotation matrix to a quater-
nion, is slightly more complicated. Inspection of Eq. 125
yields the following relations:
4q
2
0
= 1 + r
q11
(q) + r
q22
(q) + r
q33
(q) (131)
4q
2
1
= 1 + r
q11
(q) r
q22
(q) r
q33
(q) (132)
4q
2
2
= 1 r
q11
(q) + r
q22
(q) r
q33
(q) (133)
4q
2
3
= 1 r
q11
(q) r
q22
(q) + r
q33
(q) (134)
4q
2
q
3
= r
q23
(q) + r
q32
(q) (135)
4q
1
q
3
= r
q31
(q) + r
q13
(q) (136)
4q
1
q
2
= r
q12
(q) + r
q21
(q) (137)
4q
0
q
1
= r
q23
(q) r
q32
(q) (138)
4q
0
q
2
= r
q31
(q) r
q13
(q) (139)
4q
0
q
3
= r
q12
(q) r
q21
(q). (140)
From these we arrive at four dierent inverse mappings.
These are q
i
R
: SO(3) H for i {0, 1, 2, 3}, dened by
q
0
R
(R) =
1
2
_

_
(1 + r
11
+ r
22
+ r
33
)
1
2
(r
23
r
32
)/(1 + r
11
+ r
22
+ r
33
)
1
2
(r
31
r
13
)/(1 + r
11
+ r
22
+ r
33
)
1
2
(r
12
r
21
)/(1 + r
11
+ r
22
+ r
33
)
1
2
_

_
(141)
q
1
R
(R) =
1
2
_

_
(r
23
r
32
)/(1 + r
11
r
22
r
33
)
1
2
(1 + r
11
r
22
r
33
)
1
2
(r
12
+ r
21
)/(1 + r
11
r
22
r
33
)
1
2
(r
31
+ r
13
)/(1 + r
11
r
22
r
33
)
1
2
_

_
(142)
q
2
R
(R) =
1
2
_

_
(r
31
r
13
)/(1 r
11
+ r
22
r
33
)
1
2
(r
12
+ r
21
)/(1 r
11
+ r
22
r
33
)
1
2
(1 r
11
+ r
22
r
33
)
1
2
(r
23
+ r
32
)/(1 r
11
+ r
22
r
33
)
1
2
_

_
(143)
q
3
R
(R) =
1
2
_

_
(r
12
r
21
)/(1 r
11
r
22
+ r
33
)
1
2
(r
31
+ r
13
)/(1 r
11
r
22
+ r
33
)
1
2
(r
23
+ r
32
)/(1 r
11
r
22
+ r
33
)
1
2
(1 r
11
r
22
+ r
33
)
1
2
_

_
. (144)
Depending on the values of R, some of these functions
will produce complex results. To avoid such an event, we
dene the following composite function, which selects the
best of these four, depending on the parameters of R. The
function, q
R
: SO(3) H, is
q
R
(R) :=
_

_
q
0
R
(R) if r
22
> r
33
, r
11
> r
22
, r
11
> r
33
q
1
R
(R) if r
22
< r
33
, r
11
> r
22
, r
11
> r
33
q
2
R
(R) if r
22
> r
33
, r
11
< r
22
, r
11
< r
33
q
3
R
(R) if r
22
< r
33
, r
11
< r
22
, r
11
< r
33
.
(145)
15
6.6 Quaternion Rates Angular Velocity
The time derivative of the unit quaternion is the vector of
quaternion rates. The quaternion rates, q, are related to
the angular velocity. The functions that map a unit quater-
nion and its temporal derivative to the angular velocity in
world and body-xed coordinates are
q
: H R
4
R
3
and

q
: HR
4
R
3
, dened by
_
0

q
(q, q)
_
= 2 q q = 2Q(q)
T
q (146)
_
0

q
(q, q)
_
= 2 q q = 2

Q(q)
T
q. (147)
More compactly:

q
(q, q) := 2W(q) q (148)

q
(q, q) := 2W

(q) q, (149)
where the quaternion rates matrices, W : H R
34
and
W

: H R
34
, are dened by
W(q) :=
_
_
q
1
q
0
q
3
q
2
q
2
q
3
q
0
q
1
q
3
q
2
q
1
q
0
_
_
(150)
W

(q) :=
_
_
q
1
q
0
q
3
q
2
q
2
q
3
q
0
q
1
q
3
q
2
q
1
q
0
_
_
. (151)
The derivatives of the quaternion rates matrices with re-
spect to the parameters of the quaternion are
W
q
0
=
_
_
0 1 0 0
0 0 1 0
0 0 0 1
_
_
,
W
q
1
=
_
_
1 0 0 0
0 0 0 1
0 0 1 0
_
_
, (152)
W
q
2
=
_
_
0 0 0 1
1 0 0 0
0 1 0 0
_
_
,
W
q
3
=
_
_
0 0 1 0
0 1 0 0
1 0 0 0
_
_
, (153)
W

q
0
=
_
_
0 1 0 0
0 0 1 0
0 0 0 1
_
_
,
W

q
1
=
_
_
1 0 0 0
0 0 0 1
0 0 1 0
_
_
, (154)
W

q
2
=
_
_
0 0 0 1
1 0 0 0
0 1 0 0
_
_
,
W

q
3
=
_
_
0 0 1 0
0 1 0 0
1 0 0 0
_
_
, (155)
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

: HR
3
R
4
and q

: HR
3
R
4
q

(q, ) =
1
2
q
_
0

_
=
1
2
Q(q)
_
0

_
(156)
q

(q,

) =
1
2
_
0

_
q =
1
2

Q(q)
_
0

_
. (157)
More compactly:
q

(q, ) =
1
2
W(q)
T
(158)
q

(q,

) =
1
2
W

(q)
T

. (159)
6.8 Quaternion Rates Angular Acceler-
ation
The angular acceleration, expressed in the global and body-
xed coordinates may also be related to time derivatives
of the quaternion parameters by
_
0

_
= 2 q q + 2
_
q
2
0
_
(160)
= 2Q(q)
T
q + 2
_
q
2
0
_
(161)
_
0

_
= 2 q q + 2
_
q
2
0
_
(162)
= 2

Q(q)
T
q + 2
_
q
2
0
_
. (163)
More compactly:

q
(q, q) := 2W(q) q (164)

q
(q, q) := 2W

(q) q. (165)
6.9 Quaternion Rates Angular Acceler-
ation
The inverse mappings, from the angular acceleration rates
to the second derivative of the quaternion, are
q

(q, ) :=
1
2
W(q)
T
(166)
q

(q,

) :=
1
2
W

(q)
T

. (167)
6.10 Unit Quaternion Cayley-Klein Pa-
rameters
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, +

= 1, (169)

= 0, + = 1, (170)
= , and = , (171)
where is the complex conjugate of .
16
The function that maps the Cayley-Klein parameters
to their corresponding unit quaternion, q
K
: C
22
H, is
q
K
__


_
=
_

_
1
2
( + )

i
2
( + )
1
2
( )

i
2
( )
_

_
. (172)
The function that maps the Cayley-Klein parameters to
their corresponding rotation matrix, R
c
: C
22
SO(3),
is
R
K
__


_
= (173)
_
_
1
2
(
2

2
+
2
)
i
2
(
2

2
+
2
+
2
) ()
i
2
(
2

2
+
2

2
)
1
2
(
2
+
2
+
2
+
2
) i (+)
() i (+) (+)
_
_
.
6.11 Unit Quaternion Cayley-Klein Pa-
rameters
The inverse mapping is K
q
: H C
22
, dened by
K
q
(q) =
_

q
(q)
q
(q)

q
(q)
q
(q)
_
=
_
q
0
+ iq
3
iq
1
+ q
2
iq
1
q
2
q
0
iq
3
_
. (174)
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 nite rotation may be achieved by a single rotation
about an appropriately chosen axis. It is therefore possi-
ble to parameterize the attitude of a rigid body with an
angle R and a unit vector n S
2
, where S
2
:= {v
R
3
| v = 1}. The quaternion that arises from a rotation
about an axis n is given by the axis-angle quaternion
function, q
a
: R S
2
H, dene by
q
a
(, n) :=
_
cos
_
1
2

_
nsin
_
1
2

_
_
. (175)
Here, we emphasize that we are constrained to consider
only vectors n that satisfy the quadratic norm constraint,
n = 1. Dierentiating with respect to and n yields
q
a

=
_

1
2
sin
_
1
2

_
1
2
ncos
_
1
2

_
_
(176)
q
a
n
=
_
0
T
I
3
sin
_
1
2

_
_
(177)
=
_

_
0 0 0
s

2
0 0
0 s

2
0
0 0 s

2
_

_
. (178)
The corresponding quaternion matrices are given by the
functions Q
a
: R S
2
R
44
and

Q
a
: R S
2
R
44
,
where
Q
a
(, n) = Q(q
a
(, n)) (179)
=
_

_
c

2
n
1
s

2
n
2
s

2
n
3
s

2
n
1
s

2
c

2
n
3
s

2
n
2
s

2
n
2
s

2
n
3
s

2
c

2
n
1
s

2
n
3
s

2
n
2
s

2
n
1
s

2
c

2
_

_
(180)

Q
a
(, n) =

Q(q
a
(, n)) (181)
=
_

_
c

2
n
1
s

2
n
2
s

2
n
3
s

2
n
1
s

2
c

2
n
3
s

2
n
2
s

2
n
2
s

2
n
3
s

2
c

2
n
1
s

2
n
3
s

2
n
2
s

2
n
1
s

2
c

2
_

_
. (182)
The corresponding rotation matrix is given by the function
R
a
: R S
2
SO(3), dene by
R
a
(, n) = R
q
(q
a
(, n)) (183)
=
_
r
a1
(, n) r
a2
(, n) r
a3
(, n)

, (184)
the columns of which read
r
a1
(, n) =
_
_
_
n
1
2
n
3
2
n
2
2
_
s

2
2
+ c

2
2
2n
1
n
2
s

2
2
2n
3
c

2
s

2
2n
1
n
3
s

2
2
+ 2n
2
c

2
s

2
_
_
(185)
r
a2
(, n) =
_
_
2n
1
n
2
s

2
2
+ 2n
3
c

2
s

2 _
n
2
2
n
3
2
n
1
2
_
s

2
2
+ c

2
2
2n
2
n
3
s

2
2
2n
1
c

2
s

2
_
_
(186)
r
a3
(, n) =
_
_
2n
1
n
3
s

2
2
2n
2
c

2
s

2
2n
2
n
3
s

2
2
+ 2n
1
c

2
s

2 _
n
3
2
n
2
2
n
1
2
_
s

2
2
+ c

2
2
_
_
. (187)
This representation, while perhaps more intuitive than
the quaternion, is functionally equivalent to it: both re-
quire four parameters and a single quadratic constraint.
In order to overcome this problem, and produce a quater-
nion 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. Dierentiating
Eqs. 181-187 with respect to and n yields
r
a1

=
_
_

1
2
s

_
1 n
1
2
+ n
2
2
+ n
3
2
_
n
1
n
2
s

n
3
c

n
1
n
3
s

+ n
2
c

_
_
(188)
r
a2

=
_
_
n
1
n
2
s

+ n
3
c

1
2
s

_
1 + n
1
2
n
2
2
+ n
3
2
_
n
2
n
3
s

n
1
c

_
_
(189)
r
a3

=
_
_
n
1
n
3
s

n
2
c

n
2
n
3
s

+ n
1
c

1
2
s

_
1 + n
1
2
+ n
2
2
n
3
2
_
_
_
(190)
R
a
n
1
=
_
_
n
1
(1 c

) n
2
(1 c

) n
3
(1 c

)
n
2
(1 c

) n
1
(1 c

) s

n
3
(1 c

) s

n
1
(1 c

)
_
_
(191)
17
R
a
n
2
=
_
_
n
2
(1 c

) n
1
(1 c

) s

n
1
(1 c

) n
2
(1 c

) n
3
(1 c

)
s

n
3
(1 c

) n
2
(1 c

)
_
_
(192)
R
a
n
3
=
_
_
n
3
(1 c

) s

n
1
(1 c

)
s

n
3
(1 c

) n
2
(1 c

)
n
1
(1 c

) n
2
(1 c

) n
3
(1 c

)
_
_
(193)
Q
a

=
c
/2
2
_

_
t
/2
n
1
n
2
n
3
n
1
t
/2
n
3
n
2
n
2
n
3
t
/2
n
1
n
3
n
2
n
1
t
/2
_

_
(194)


Q
a

=
c
/2
2
_

_
t
/2
n
1
n
2
n
3
n
1
t
/2
n
3
n
2
n
2
n
3
t
/2
n
1
n
3
n
2
n
1
t
/2
_

_
(195)
Q
a
n
i
= sin
_

2
_
Q
q
i
, and (196)


Q
a
n
i
= sin
_

2
_


Q
q
i
, for i {1, 2, 3}. (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/q
i
and

Q/q
i
may be found
in Eqs. 116-118.
6.13 Unit Quaternion Axis-Angle
The inverse mappings, from a unit quaternion to the cor-
responding axis and angle of rotation, are
q
: H R and
n
q
: H S
2
, dened by

q
(q) := 2acos(q
0
) (198)
n
q
(q) :=
q
1:3
q
1:3

=
q
1:3
_
1 q
2
0
. (199)
6.14 Unit Quaternion Euler Angles
The unit quaternion arising from a particular Euler angle
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
unit quaternion is
q
ijk
(, , ) = q
a
(, e
i
) q
a
(, e
j
) q
a
(, e
k
). (200)
Dierentiating with respect to the Euler angles yields
q
ijk
(, , )

=
q
a

, ei
q
a
(, e
j
) q
a
(, e
k
) (201)
q
ijk
(, , )

= q
a
(, e
i
)
q
a

, ej
q
a
(, e
k
) (202)
q
ijk
(, , )

= q
a
(, e
i
) q
a
(, e
j
)
q
a

, e
k
. (203)
6.15 Unit Quaternion Euler Angles
The inverse mapping, from a unit quaternion to a set of
Euler angles, is u
ijk
(R
q
(q)). These results are presented
with each Euler angle set in Sec. 8.
6.16 Optimization with Quaternions
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 in-
cluded as state variables in an optimization. In these cases,
the dicult problem of how to impose the unity norm con-
straint arises. Various techniques are used to solve this
problem, though none of them are completely satisfactory.
For iterative optimization algorithms, such as the con-
jugate gradient algorithm, it is possible to simply re-normalize
the quaternions after each iteration. When using a direct
method, however, this strategy is usually insucient. In
such cases, terms of the form c (1 q)
2
are also included
in the objective function to prevent large violations of the
constraint. Renormalization after each iteration is usually
still necessary.
7 Rotation Vector Representation
One of the major drawbacks of quaternions is that they re-
quire a quadratic norm constraint in order to be valid rota-
tions. This problem can be overcome by folding the unity
norm constraint into the parametrization. There are sev-
eral ways in which to do this, but we present what appears
to be the most natural three-dimensional parametrization
of the quaternion representation of an objects attitude.
7.1 Rotation Vector Axis-Angle
We dene the rotation vector as a function of the axis and
angle of a rotation, v
a
: R S
2
R
3
, by
v
a
(, n) := n. (204)
7.2 Rotation Vector Axis-Angle
Noting that n = 1, we may invert this denition to yield
the functions
v
: R
3
R and n
v
: R
3
S
2
, dened by

v
(v) := v = v (205)
n
v
(v) :=
v
v
=
v
v
. (206)
Here we have used the shorthand,
v := v. (207)
This will be used throughout this article.
18
7.3 Rotation Vector Unit Quaternion
We dene the function that maps a rotation vector to a
unit quaternion, q
v
: R
3
H, by
q
v
(v) := q
a
(
v
(v), n
v
(v)) =
_
cos
_
v
2
_
v
v
sin
_
v
2
_
_
(208)
lim
v0
q
v
(v) = lim
v0
_
1
1
2
v
_
. (209)
The derivatives of q
v
with respect to the parameters of
v are presented in this section. In order to provide com-
pact expressions, we have factored them in terms of the
following two quantities:
a := c
v
2
v 2s
v
2
(210)
b := s
v
2
v
2
6c
v
2
v + 12s
v
2
. (211)
We dierentiate Eq. 208 to yield
G(v) = [ g
1
(v), g
2
(v), g
3
(v) ]
:=
q
v
v
=
_
q
v
v
1
,
q
v
v
2
,
q
v
v
3
_
=
s
v
2
2v
_
v
T
2I
3
_
+
a
2v
3
_
0
T
vv
T
_
(212)
=
s
v
2
2v
_

_
v
1
v
2
v
3
2 0 0
0 2 0
0 0 2
_

_ +
a
2v
3
_

_
0 0 0
v
1
2
v
1
v
2
v
1
v
3
v
1
v
2
v
2
2
v
2
v
3
v
1
v
3
v
2
v
3
v
3
2
_

_ (213)
=
1
2v
3
_

_
v
1
v
2
s
v
2
v
2
v
2
s
v
2
v
3
v
2
s
v
2
2v
2
s
v
2
+ v
1
2
a v
1
v
2
a v
1
v
3
a
v
1
v
2
a 2v
2
s
v
2
+ v
2
2
a v
2
v
3
a
v
1
v
3
a v
2
v
3
a 2v
2
s
v
2
+ v
3
2
a
_

_
(214)
lim
v0
G(v) =
1
4
_

_
v
1
v
2
v
3
2 0 0
0 2 0
0 0 2
_

_ (215)
G
v
i
=
s
v
2
2v
_
e
T
i
0
33
_
+
a
4v
3
_
v
i
v
T
2
_
e
i
v
T
+v e
T
i
+ v
i
I
3
_
_
+
v
i
b
4v
5
_
0
T
vv
T
_
(216)
lim
v0
G
v
i
=
1
4
_
e
T
i
0
33
_
(217)
G
v
1
=
s
v
2
2v
_

_
1 0 0
0 0 0
0 0 0
0 0 0
_

_ +
a
4v
3
_

_
v
2
1
v
1
v
2
v
1
v
3
6v
1
2v
2
2v
3
2v
2
2v
1
0
2v
3
0 2v
1
_

_
+
v
1
b
4v
5
_

_
0 0 0
v
2
1
v
1
v
2
v
1
v
3
v
1
v
2
v
2
2
v
2
v
3
v
1
v
3
v
2
v
3
v
2
3
_

_ (218)
G
v
2
=
s
v
2
2v
_

_
0 1 0
0 0 0
0 0 0
0 0 0
_

_ +
a
4v
3
_

_
v
1
v
2
v
2
2
v
2
v
3
2v
2
2v
1
0
2v
1
6v
2
2v
3
0 2v
3
2v
2
_

_
+
v
2
b
4v
5
_

_
0 0 0
v
2
1
v
1
v
2
v
1
v
3
v
1
v
2
v
2
2
v
2
v
3
v
1
v
3
v
2
v
3
v
2
3
_

_ (219)
G
v
3
=
s
v
2
2v
_

_
0 0 1
0 0 0
0 0 0
0 0 0
_

_ +
a
4v
3
_

_
v
1
v
3
v
2
v
3
v
2
3
2v
3
0 2v
1
0 2v
3
2v
2
2v
1
2v
2
6v
3
_

_
+
v
3
b
4v
5
_

_
0 0 0
v
2
1
v
1
v
2
v
1
v
3
v
1
v
2
v
2
2
v
2
v
3
v
1
v
3
v
2
v
3
v
2
3
_

_. (220)
7.4 Rotation Vector Unit Quaternion
The inverse mapping, v
q
: H R
3
, which maps a unit
quaternion to a rotation vector, is dened by
v
q
(q) :=
q
(q)n
q
(q) (221)
= 2 acos(q
0
)
q
1:3
q
1:3

(222)
=
2 acos(q
0
)
(1 q
2
0
)
1
2
q
1:3
(223)
lim
q1:30
v
q
(q) = 2q
1:3
(224)
c :=
1
1 q
0
2
(225)
d :=
acos (q
0
)
_
1 q
0
2
(226)
H(q) :=
v
q
q
=
_
_
2cq
1
(dq
0
1) 2d 0 0
2cq
2
(dq
0
1) 0 2d 0
2cq
3
(dq
0
1) 0 0 2d
_
_
(227)
lim
q
1:3
0
H(q) =
_
_
0 2 0 0
0 0 2 0
0 0 0 2
_
_
. (228)
7.5 Rotation Vector Quaternion Matri-
ces
The quaternion matrices may be written as a function of
the rotation vector by composition of Eqs. 108 and 110,
19
and Eq. 208:
Q
v
(v) := Q(q
v
(v))
=
1
v
_

_
vc
v
2
v
1
s
v
2
v
2
s
v
2
v
3
s
v
2
v
1
s
v
2
vc
v
2
v
3
s
v
2
v
2
s
v
2
v
2
s
v
2
v
3
s
v
2
vc
v
2
v
1
s
v
2
v
3
s
v
2
v
2
s
v
2
v
1
s
v
2
vc
v
2
_

_
(229)

Q
v
(v) :=

Q(q
v
(v))
=
1
v
_

_
vc
v
2
v
1
s
v
2
v
2
s
v
2
v
3
s
v
2
v
1
s
v
2
vc
v
2
v
3
s
v
2
v
2
s
v
2
v
2
s
v
2
v
3
s
v
2
vc
v
2
v
1
s
v
2
v
3
s
v
2
v
2
s
v
2
v
1
s
v
2
vc
v
2
_

_
(230)
lim
v0
Q
v
(v) =
1
2
_

_
2 v
1
v
2
v
3
v
1
2 v
3
v
2
v
2
v
3
2 v
1
v
3
v
2
v
1
2
_

_ (231)
lim
v0

Q
v
(v) =
1
2
_

_
2 v
1
v
2
v
3
v
1
2 v
3
v
2
v
2
v
3
2 v
1
v
3
v
2
v
1
2
_

_. (232)
The derivatives of the quaternion matrices with respect to
the rotation vector parameters are
Q
v
v
j
=
3

i=0
Q
q
i
q
vi
v
j
=
3

i=0
Q
q
i
g
ij
(v)
= Q(g
j
(v)) (233)
lim
v0
Q
v
v
j
=
1
2
Q
v
q
j
(234)


Q
v
v
j
=
3

i=0


Q
q
i
q
vi
v
j
=
3

i=0


Q
q
i
g
ij
(v)
=

Q(g
j
(v)) (235)
lim
v0


Q
v
v
j
=
1
2


Q
v
q
j
. (236)
7.6 Rotation Vector Quaternion Rates
Matrices
The quaternion rates matrices may be written as a function
of the rotation vector by composition of Eqs. 150 and 151,
and Eq. 208:
W
v
(v) := W(q
v
(v))
=
1
v
_
_
v
1
s
v
2
vc
v
2
v
3
s
v
2
v
2
s
v
2
v
2
s
v
2
v
3
s
v
2
vc
v
2
v
1
s
v
2
v
3
s
v
2
v
2
s
v
2
v
1
s
v
2
vc
v
2
_
_
(237)
W

v
(v) := W

(q
v
(v))
=
1
v
_
_
v
1
s
v
2
vc
v
2
v
3
s
v
2
v
2
s
v
2
v
2
s
v
2
v
3
s
v
2
vc
v
2
v
1
s
v
2
v
3
s
v
2
v
2
s
v
2
v
1
s
v
2
vc
v
2
_
_
(238)
lim
v0
W
v
(v) =
1
2
_
_
v
1
2 v
3
v
2
v
2
v
3
2 v
1
v
3
v
2
v
1
2
_
_
(239)
lim
v0
W

v
(v) =
1
2
_
_
v
1
2 v
3
v
2
v
2
v
3
2 v
1
v
3
v
2
v
1
2
_
_
. (240)
The derivatives of the quaternion rates matrices with re-
spect to the rotation vector parameters are
W
v
v
j
=
3

i=0
W
q
i
q
vi
v
j
=
3

i=0
W
q
i
g
ij
(v)
= W (g
j
(v)) (241)
W

v
v
j
=
3

i=0
W

q
i
q
vi
v
j
=
3

i=0
W

q
i
g
ij
(v)
= W

(g
j
(v)) . (242)
7.7 Rotation Vector Rotation Matrix
The rotation matrix may be written as a function of the
rotation vector by composition of Eqs. 125 and 208:
R
v
(v) := R
q
(q
v
(v))
=
_
r
v1
(v) r
v2
(v) r
v3
(v)

, (243)
the columns of which read
r
v1
(v) =
1
v
2
_
_
_
v
2
1
v
2
2
v
2
3
_
s
2
v
2
+ v
2
c
2
v
2
2s
v
2
_
v
1
v
2
s
v
2
vv
3
c
v
2
_
2s
v
2
_
v
1
v
3
s
v
2
+ vv
2
c
v
2
_
_
_
(244)
r
v2
(v) =
1
v
2
_
_
2s
v
2
_
v
1
v
2
s
v
2
+ vv
3
c
v
2
_
_
v
2
2
v
2
3
v
2
1
_
s
2
v
2
+ v
2
c
2
v
2
2s
v
2
_
v
2
v
3
s
v
2
vv
1
c
v
2
_
_
_
(245)
r
v3
(v) =
1
v
2
_
_
2s
v
2
_
v
1
v
3
s
v
2
vv
2
c
v
2
_
2s
v
2
_
v
2
v
3
s
v
2
+ vv
1
c
v
2
_
_
v
2
3
v
2
1
v
2
2
_
s
2
v
2
+ v
2
c
2
v
2
_
_
. (246)
For very small v, we have:
lim
v0
R
v
(v) =
_
_
1 v
3
v
2
v
3
1 v
1
v
2
v
1
1
_
_
. (247)
The derivatives of the rotation matrix with respect to the
parameters of the rotation vector are
R
v
v
j
=
_
r
v1
vj
r
v2
vj
r
v3
vj
_
=
3

i=0
R
q
q
i

qv(v)
q
vi
v
j
. (248)
20
where
r
vi
v
j
= F
i
(q
v
(v)) g
j
(v) (249)
F
1
(q) =
_
_
q
0
q
1
q
2
q
3
q
3
q
2
q
1
q
0
q
2
q
3
q
0
q
1
_
_
(250)
F
2
(q) =
_
_
q
3
q
2
q
1
q
0
q
0
q
1
q
2
q
3
q
1
q
0
q
3
q
2
_
_
(251)
F
3
(q) =
_
_
q
2
q
3
q
0
q
1
q
1
q
0
q
3
q
2
q
0
q
1
q
2
q
3
_
_
(252)
lim
v0
R
v
v
j
= C( e
i
) (253)
lim
v0
R
v
v
1
=
_
_
0 0 0
0 0 1
0 1 0
_
_
, lim
v0
R
v
v
2
=
_
_
0 0 1
0 0 0
1 0 0
_
_
,
lim
v0
R
v
v
3
=
_
_
0 1 0
1 0 0
0 0 0
_
_
. (254)
7.8 Rotation Vector Multiplication
The multiplication of two rotation vectors u and v R
3
is
dened in terms of the product of quaternions:
v u = v
m
(v, u) = v
q
(q
m
(q
v
(v), q
v
(u))) . (255)
This product is best computed as written, by converting
each rotation vector to a unit quaternion, performing the
quaternion product, and then converting back to a rotation
vector.
The derivatives of the rotation vector multiplication
function are
v
m
(v,u)
v
= H(q
m
(q
v
(v), q
v
(u))

Q(q
v
(u)) G(v) (256)
v
m
(v,u)
u
= H(q
m
(q
v
(v), q
v
(u)) Q(q
v
(v)) G(u). (257)
Here, H(q),

Q(q), and G(v) are given in Eqs. 227 , 110,
and 212.
7.9 Rotation Vector Rates Quaternion
Rates
The quaternion rates as a function of the rotation vector
rates are given in the function q
v
: H R
3
R
4
, dened
by
q
v
(q, v) =
q
v
v
v
t
= G(v) v. (258)
Here, G(v) is given in Eq. 212.
7.10 Rotation Vector Rates Angular Ve-
locity
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-xed coordinates are
v
: R
3

R
3
R
3
and

v
: R
3
R
3
R
3
, dened by

v
(v, v) := 2W
v
(v) q
v
(v)
= 2W
v
(v)G(v) v
= 2V (v) v (259)

v
(v, v) := 2W

v
(v) q
v
(v)
= 2W

v
(v)G(v) v
= 2V (v)
T
v, (260)
where the rotation vector rates matrix, V : R
3
R
33
, is
dened by
V (v) := W
v
(v)G(v), (261)
where W
v
(v) and G(v) are dened in Eqs. 237 and 212.
As it also holds that

= R
v
(v), we have that
R
v
(v) = V (v)
T
V (v)
1
(262)
R
v
(v)
T
= V (v)V (v)
T
. (263)
7.11 Rotation Vector Rates Angular Ve-
locity
The functions that map the angular velocity in the body-
xed and world coordinates to the rotation vector rates,
v

: R
3
R
3
R
3
and v

: R
3
R
3
R
3
, are dened
by
v

(v, ) =
1
2
V (v)
1
(264)
v

(v,

) =
1
2
V (v)
T

. (265)
7.12 Integration of Angular Velocity
Quaternions are very well suited to tracking the attitude
of an object by integrating the body-xed angular velocity
over time.
Consider an object with a body-xed angular velocity
of

(t). Let us consider the change in attitude from time


t
0
to time t
1
. We dene the rotation vector over this in-
terval to be
v

(t
0
, t
1
) :=
_
t1
t0

(t) dt. (266)


If the body-xed angular velocity is provided as discrete
samples, as, for example, from a set of rate gyros, the inte-
gration will have to be carried out numerically. The sim-
plest such numerical integration is to compute the product
of the time interval and the average of all the samples taken
during that time interval.
21
If at time t
0
the body has a quaternion attitude of q
0
,
then the attitude at time t
1
is
q
1
= [q
v
v

(t
0
, t
1
)] q
0
= q
v
(v

(t
0
, t
1
)) q
0
. (267)
This equation may be easily generalized to read
q
i+1
= q
v
(v

(t
i
, t
i+1
)) q
i
, (268)
giving us a simple update rule for tracking the attitude of
an object over time, given some measure of the body-xed
angular velocity. This method is much more accurate than
integrating the Euler angle rates.
8 A Catalog of Euler Angle Param-
eterizations
In this section we present an exhaustive catalog of the
twelve dierent Euler angle parameterizations, including
conversions to and from rotation matrices and quaternions,
the relationship between the Euler angle rates and the an-
gular velocity, and various derivatives of the fundamental
results with respect to the Euler angles.
22
8.1 Euler Angle Sequence (1,2,1)
R
121
(, , ) = R
1
()R
2
()R
1
() =
_
_
c

+ s

+ c

_
_
(269)
L{R
121
(, , )} =
_
_
1 0
0 1 +
1
_
_
(270)
u
121
(R) =
_
_

121
(R)

121
(R)

121
(R)
_
_
=
_
_
atan2 (r
21
, r
31
)
acos (r
11
)
atan2 (r
12
, r
13
)
_
_
(271)
u
121
(R
q
(q)) =
_

_
atan2
_
2q
1
q
2
2q
0
q
3
,
2q
1
q
3
+ 2q
0
q
2
_
acos
_
q
1
2
+ q
0
2
q
3
2
q
2
2
_
atan2
_
2q
1
q
2
+ 2q
0
q
3
,
2q
1
q
3
+ 2q
0
q
2
_
_

_
(272)
E
121
(, , ) =
_
_
c

0 1
s

0
s

0
_
_
(273)
L{E
121
(, , )} =
_
_
1 0 1
0 1 0
0
_
_
(274)
E

121
(, , ) =
_
_
1 0 c

0 c

0 s

_
_
(275)
L{E

121
(, , )} =
_
_
1 0 1
0 1 0
0
_
_
(276)
[E
121
(, , )]
1
=
1
s

_
_
0 s

0 s

_
_
(277)
[E

121
(, , )]
1
=
1
s

_
_
s

0 c

0 s

_
_
(278)
q
121
(, , ) =
_

_
c
/2
c
/2
c
/2
s
/2
c
/2
s
/2
c
/2
c
/2
s
/2
+ c
/2
c
/2
s
/2
c
/2
c
/2
s
/2
+ s
/2
s
/2
s
/2
c
/2
s
/2
s
/2
s
/2
c
/2
s
/2
_

_
(279)
R
121

=
_
_
0 0 0
c

+ c

+ s

_
_
(280)
y
y, y

y
z

x, x

z
x, x
z
Figure 5: Euler Angle Sequence (1,2,1)
R
121

=
_
_
s

_
_
(281)
R
121

=
_
_
0 s

0 c

0 s

_
_
(282)
E
121

=
_
_
s

0 0
c

0 0
c

0 0
_
_
(283)
E
121

=
_
_
0 0 0
s

0
s

0
_
_
(284)
E

121

=
_
_
0 0 0
0 s

0 c

_
_
(285)
E

121

=
_
_
0 0 s

0 0 s

0 0 c

_
_
(286)
23
8.2 Euler Angle Sequence (1,2,3)
R
123
(, , ) = R
1
()R
2
()R
3
() =
_
_
c

+ c

+ s

_
_
(287)
L{R
123
(, , )} =
_
_
1
1
1
_
_
(288)
u
123
(R) =
_
_

123
(R)

123
(R)

123
(R)
_
_
=
_
_
atan2 (r
23
, r
33
)
asin(r
13
)
atan2 (r
12
, r
11
)
_
_
(289)
u
123
(R
q
(q)) =
_

_
atan2
_
2q
2
q
3
+ 2q
0
q
1
,
q
3
2
q
2
2
q
1
2
+ q
0
2
_
asin
_
2q
1
q
3
2q
0
q
2
_
atan2
_
2q
1
q
2
+ 2q
0
q
3
,
q
1
2
+ q
0
2
q
3
2
q
2
2
_
_

_
(290)
E
123
(, , ) =
_
_
c

0
c

0
s

0 1
_
_
(291)
L{E
123
(, , )} =
_
_
1 0
1 0
0 1
_
_
(292)
E

123
(, , ) =
_
_
1 0 s

0 c

0 s

_
_
(293)
L{E

123
(, , )} =
_
_
1 0
0 1
0 1
_
_
(294)
[E
123
(, , )]
1
=
1
c

_
_
c

0
c

0
c

_
_
(295)
[E

123
(, , )]
1
=
1
c

_
_
c

0 c

0 s

_
_
(296)
q
123
(, , ) =
_

_
c
/2
c
/2
c
/2
+ s
/2
s
/2
s
/2
c
/2
s
/2
s
/2
+ c
/2
c
/2
s
/2
c
/2
c
/2
s
/2
+ s
/2
c
/2
s
/2
c
/2
c
/2
s
/2
s
/2
c
/2
s
/2
_

_
(297)
R
123

=
_
_
0 0 0
c

+ s

+ c

_
_
(298)
y, y
y
y

z, z

x, x
x

z
x
Figure 6: Euler Angle Sequence (1,2,3)
R
123

=
_
_
c

_
_
(299)
R
123

=
_
_
c

0
s

0
c

+ s

+ s

0
_
_
(300)
E
123

=
_
_
c

0 0
s

0 0
c

0 0
_
_
(301)
E
123

=
_
_
c

0
c

0
0 0 0
_
_
(302)
E

123

=
_
_
0 0 0
0 s

0 c

_
_
(303)
E

123

=
_
_
0 0 c

0 0 s

0 0 c

_
_
(304)
24
8.3 Euler Angle Sequence (1,3,1)
R
131
(, , ) = R
1
()R
3
()R
1
() =
_
_
c

+ s

+ c

_
_
(305)
L{R
131
(, , )} =
_
_
1 0
1 +
0 1
_
_
(306)
u
131
(R) =
_
_

131
(R)

131
(R)

131
(R)
_
_
=
_
_
atan2 (r
31
, r
21
)
acos (r
11
)
atan2 (r
13
, r
12
)
_
_
(307)
u
131
(R
q
(q)) =
_

_
atan2
_
2q
1
q
3
+ 2q
0
q
2
,
2q
1
q
2
+ 2q
0
q
3
_
acos
_
q
1
2
+ q
0
2
q
3
2
q
2
2
_
atan2
_
2q
1
q
3
2q
0
q
2
,
2q
1
q
2
+ 2q
0
q
3
_
_

_
(308)
E
131
(, , ) =
_
_
c

0 1
c

0
s

0
_
_
(309)
L{E
131
(, , )} =
_
_
1 0 1
0
0 1 0
_
_
(310)
E

131
(, , ) =
_
_
1 0 c

0 s

0 c

_
_
(311)
L{E

131
(, , )} =
_
_
1 0 1
0
0 1 0
_
_
(312)
[E
131
(, , )]
1
=
1
s

_
_
0 c

0 s

_
_
(313)
[E

131
(, , )]
1
=
1
s

_
_
s

0 s

0 c

_
_
(314)
q
131
(, , ) =
_

_
c
/2
c
/2
c
/2
s
/2
c
/2
s
/2
c
/2
c
/2
s
/2
+ c
/2
c
/2
s
/2
c
/2
s
/2
s
/2
+ s
/2
c
/2
s
/2
c
/2
c
/2
s
/2
+ s
/2
s
/2
s
/2
_

_
(315)
R
131

=
_
_
0 0 0
s

+ c

+ s

_
_
(316)
y
y
y

x, x

z
x, x

z, z
z
Figure 7: Euler Angle Sequence (1,3,1)
R
131

=
_
_
s

_
_
(317)
R
131

=
_
_
0 s

0 c

0 s

_
_
(318)
E
131

=
_
_
s

0 0
c

0 0
c

0 0
_
_
(319)
E
131

=
_
_
0 0 0
s

0
s

0
_
_
(320)
E

131

=
_
_
0 0 0
0 c

0 s

_
_
(321)
E

131

=
_
_
0 0 s

0 0 c

0 0 s

_
_
(322)
25
8.4 Euler Angle Sequence (1,3,2)
R
132
(, , ) = R
1
()R
3
()R
2
() =
_
_
c

+ s

+ s

+ c

+ c

_
_
(323)
L{R
132
(, , )} =
_
_
1
1
1
_
_
(324)
u
132
(R) =
_
_

132
(R)

132
(R)

132
(R)
_
_
=
_
_
atan2 (r
32
, r
22
)
asin(r
12
)
atan2 (r
13
, r
11
)
_
_
(325)
u
132
(R
q
(q)) =
_

_
atan2
_
2q
2
q
3
+ 2q
0
q
1
,
q
2
2
q
3
2
+ q
0
2
q
1
2
_
asin
_
2q
1
q
2
+ 2q
0
q
3
_
atan2
_
2q
1
q
3
+ 2q
0
q
2
,
q
1
2
+ q
0
2
q
3
2
q
2
2
_
_

_
(326)
E
132
(, , ) =
_
_
c

0
s

0 1
c

0
_
_
(327)
L{E
132
(, , )} =
_
_
1 0
0 1
1 0
_
_
(328)
E

132
(, , ) =
_
_
1 0 s

0 s

0 c

_
_
(329)
L{E

132
(, , )} =
_
_
1 0
0 1
0 1
_
_
(330)
[E
132
(, , )]
1
=
1
c

_
_
c

0 s

0 c

_
_
(331)
[E

132
(, , )]
1
=
1
c

_
_
c

0 s

0 c

_
_
(332)
q
132
(, , ) =
_

_
c
/2
c
/2
c
/2
s
/2
s
/2
s
/2
c
/2
s
/2
s
/2
+ c
/2
c
/2
s
/2
c
/2
c
/2
s
/2
+ s
/2
c
/2
s
/2
c
/2
c
/2
s
/2
s
/2
c
/2
s
/2
_

_
(333)
R
132

=
_
_
0 0 0
s

+ c

+ c

_
_
(334)
y
y, y
y

x, x

z, z

x
z
x
Figure 8: Euler Angle Sequence (1,3,2)
R
132

=
_
_
s

_
_
(335)
R
132

=
_
_
c

0 c

+ s

0 c

+ c

0 s

_
_
(336)
E
132

=
_
_
s

0 0
c

0 0
s

0 0
_
_
(337)
E
132

=
_
_
c

0
0 0 0
c

0
_
_
(338)
E

132

=
_
_
0 0 0
0 c

0 s

_
_
(339)
E

132

=
_
_
0 0 c

0 0 c

0 0 s

_
_
(340)
26
8.5 Euler Angle Sequence (2,1,2)
R
212
(, , ) = R
2
()R
1
()R
2
() =
_
_
c

+ c

+ c

_
_
(341)
L{R
212
(, , )} =
_
_
1 0
0 1
+ 1
_
_
(342)
u
212
(R) =
_
_

212
(R)

212
(R)

212
(R)
_
_
=
_
_
atan2 (r
12
, r
32
)
acos (r
22
)
atan2 (r
21
, r
23
)
_
_
(343)
u
212
(R
q
(q)) =
_

_
atan2
_
2q
1
q
2
+ 2q
0
q
3
,
2q
2
q
3
+ 2q
0
q
1
_
acos
_
q
2
2
q
3
2
+ q
0
2
q
1
2
_
atan2
_
2q
1
q
2
2q
0
q
3
,
2q
2
q
3
+ 2q
0
q
1
_
_

_
(344)
E
212
(, , ) =
_
_
s

0
c

0 1
s

0
_
_
(345)
L{E
212
(, , )} =
_
_
0 1 0
1 0 1
0
_
_
(346)
E

212
(, , ) =
_
_
0 c

1 0 c

0 s

_
_
(347)
L{E

212
(, , )} =
_
_
0 1 0
1 0 1
0
_
_
(348)
[E
212
(, , )]
1
=
1
s

_
_
s

0 c

0 s

_
_
(349)
[E

212
(, , )]
1
=
1
s

_
_
s

0 s

0 c

_
_
(350)
q
212
(, , ) =
_

_
c
/2
c
/2
c
/2
s
/2
c
/2
s
/2
c
/2
c
/2
s
/2
+ s
/2
s
/2
s
/2
c
/2
c
/2
s
/2
+ c
/2
c
/2
s
/2
c
/2
s
/2
s
/2
+ s
/2
c
/2
s
/2
_

_
(351)
R
212

=
_
_
s

0 0 0
c

_
_
(352)
y, y
y, y

z
x

x, x

x
z
z
Figure 9: Euler Angle Sequence (2,1,2)
R
212

=
_
_
s

_
_
(353)
R
212

=
_
_
c

0 c

+ s

0 s

+ c

0 s

_
_
(354)
E
212

=
_
_
c

0 0
s

0 0
c

0 0
_
_
(355)
E
212

=
_
_
s

0
0 0 0
s

0
_
_
(356)
E

212

=
_
_
0 s

0 0 0
0 c

_
_
(357)
E

212

=
_
_
0 0 s

0 0 s

0 0 c

_
_
(358)
27
8.6 Euler Angle Sequence (2,1,3)
R
213
(, , ) = R
2
()R
1
()R
3
() =
_
_
c

+ s

+ c

_
_
(359)
L{R
213
(, , )} =
_
_
1
1
1
_
_
(360)
u
213
(R) =
_
_

213
(R)

213
(R)

213
(R)
_
_
=
_
_
atan2 (r
13
, r
33
)
asin(r
23
)
atan2 (r
21
, r
22
)
_
_
(361)
u
213
(R
q
(q)) =
_

_
atan2
_
2q
1
q
3
+ 2q
0
q
2
,
q
3
2
q
2
2
q
1
2
+ q
0
2
_
asin
_
2q
2
q
3
+ 2q
0
q
1
_
atan2
_
2q
1
q
2
+ 2q
0
q
3
,
q
2
2
q
3
2
+ q
0
2
q
1
2
_
_

_
(362)
E
213
(, , ) =
_
_
c

0
c

0
s

0 1
_
_
(363)
L{E
213
(, , )} =
_
_
1 0
1 0
0 1
_
_
(364)
E

213
(, , ) =
_
_
0 c

1 0 s

0 s

_
_
(365)
L{E

213
(, , )} =
_
_
0 1
1 0
0 1
_
_
(366)
[E
213
(, , )]
1
=
1
c

_
_
s

0
c

0
s

_
_
(367)
[E

213
(, , )]
1
=
1
c

_
_
s

0 s

0 c

_
_
(368)
q
213
(, , ) =
_

_
c
/2
c
/2
c
/2
s
/2
s
/2
s
/2
c
/2
c
/2
s
/2
s
/2
c
/2
s
/2
c
/2
s
/2
s
/2
+ c
/2
c
/2
s
/2
c
/2
c
/2
s
/2
+ s
/2
c
/2
s
/2
_

_
(369)
R
213

=
_
_
s

+ c

0 0 0
c

+ s

_
_
(370)
y
y, y
y

z,
x

x, x

z
z
x
z
Figure 10: Euler Angle Sequence (2,1,3)
R
213

=
_
_
s

_
_
(371)
R
213

=
_
_
c

0
c

0
s

+ c

+ c

0
_
_
(372)
E
213

=
_
_
s

0 0
c

0 0
c

0 0
_
_
(373)
E
213

=
_
_
c

0
c

0
0 0 0
_
_
(374)
E

213

=
_
_
0 s

0 0 0
0 c

_
_
(375)
E

213

=
_
_
0 0 s

0 0 c

0 0 c

_
_
(376)
28
8.7 Euler Angle Sequence (2,3,1)
R
231
(, , ) = R
2
()R
3
()R
1
() =
_
_
c

+ s

+ c

_
_
(377)
L{R
231
(, , )} =
_
_
1
1
1
_
_
(378)
u
231
(R) =
_
_

231
(R)

231
(R)

231
(R)
_
_
=
_
_
atan2 (r
31
, r
11
)
asin(r
21
)
atan2 (r
23
, r
22
)
_
_
(379)
u
231
(R
q
(q)) =
_

_
atan2
_
2q
1
q
3
+ 2q
0
q
2
,
q
1
2
+ q
0
2
q
3
2
q
2
2
_
asin
_
2q
1
q
2
2q
0
q
3
_
atan2
_
2q
2
q
3
+ 2q
0
q
1
,
q
2
2
q
3
2
+ q
0
2
q
1
2
_
_

_
(380)
E
231
(, , ) =
_
_
s

0 1
c

0
c

0
_
_
(381)
L{E
231
(, , )} =
_
_
0 1
1 0
1 0
_
_
(382)
E

231
(, , ) =
_
_
0 s

1 0 s

0 c

_
_
(383)
L{E

231
(, , )} =
_
_
0 1
1 0
0 1
_
_
(384)
[E
231
(, , )]
1
=
1
c

_
_
0 c

0 c

_
_
(385)
[E

231
(, , )]
1
=
1
c

_
_
c

0 c

0 s

_
_
(386)
q
231
(, , ) =
_

_
c
/2
c
/2
c
/2
+ s
/2
s
/2
s
/2
c
/2
c
/2
s
/2
s
/2
c
/2
s
/2
c
/2
s
/2
s
/2
+ c
/2
c
/2
s
/2
c
/2
c
/2
s
/2
+ s
/2
c
/2
s
/2
_

_
(387)
R
231

=
_
_
s

+ c

0 0 0
c

+ s

_
_
(388)
y, y
y

z, z

x
z

x
x, x
Figure 11: Euler Angle Sequence (2,3,1)
R
231

=
_
_
c

_
_
(389)
R
231

=
_
_
0 c

+ s

+ s

0 c

0 s

_
_
(390)
E
231

=
_
_
c

0 0
s

0 0
s

0 0
_
_
(391)
E
231

=
_
_
0 0 0
c

0
c

0
_
_
(392)
E

231

=
_
_
0 c

0 0 0
0 s

_
_
(393)
E

231

=
_
_
0 0 c

0 0 c

0 0 s

_
_
(394)
29
8.8 Euler Angle Sequence (2,3,2)
R
232
(, , ) = R
2
()R
3
()R
2
() =
_
_
c

+ c

+ c

_
_
(395)
L{R
232
(, , )} =
_
_
1
1 0
+ 0 1
_
_
(396)
u
232
(R) =
_
_

232
(R)

232
(R)

232
(R)
_
_
=
_
_
atan2 (r
32
, r
12
)
acos (r
22
)
atan2 (r
23
, r
21
)
_
_
(397)
u
232
(R
q
(q)) =
_

_
atan2
_
2q
2
q
3
2q
0
q
1
,
2q
1
q
2
+ 2q
0
q
3
_
acos
_
q
2
2
q
3
2
+ q
0
2
q
1
2
_
atan2
_
2q
2
q
3
+ 2q
0
q
1
,
2q
1
q
2
+ 2q
0
q
3
_
_

_
(398)
E
232
(, , ) =
_
_
s

0
c

0 1
s

0
_
_
(399)
L{E
232
(, , )} =
_
_
0
1 0 1
0 1 0
_
_
(400)
E

232
(, , ) =
_
_
0 s

1 0 c

0 c

_
_
(401)
L{E

232
(, , )} =
_
_
0
1 0 1
0 1 0
_
_
(402)
[E
232
(, , )]
1
=
1
s

_
_
c

0 s

0 s

_
_
(403)
[E

232
(, , )]
1
=
1
s

_
_
c

0 c

0 s

_
_
(404)
q
232
(, , ) =
_

_
c
/2
c
/2
c
/2
s
/2
c
/2
s
/2
c
/2
s
/2
s
/2
s
/2
c
/2
s
/2
c
/2
c
/2
s
/2
+ c
/2
c
/2
s
/2
c
/2
c
/2
s
/2
+ s
/2
s
/2
s
/2
_

_
(405)
R
232

=
_
_
s

0 0 0
c

_
_
(406)
y, y
y, y

z
x

z, z

z
x
x
Figure 12: Euler Angle Sequence (2,3,2)
R
232

=
_
_
c

_
_
(407)
R
232

=
_
_
c

0 c

+ s

0 s

+ c

0 s

_
_
(408)
E
232

=
_
_
c

0 0
s

0 0
c

0 0
_
_
(409)
E
232

=
_
_
s

0
0 0 0
s

0
_
_
(410)
E

232

=
_
_
0 c

0 0 0
0 s

_
_
(411)
E

232

=
_
_
0 0 c

0 0 s

0 0 s

_
_
(412)
30
8.9 Euler Angle Sequence (3,1,2)
R
312
(, , ) = R
3
()R
1
()R
2
() =
_
_
c

+ s

+ s

+ c

+ c

_
_
(413)
L{R
312
(, , )} =
_
_
1
1
1
_
_
(414)
u
312
(R) =
_
_

312
(R)

312
(R)

312
(R)
_
_
=
_
_
atan2 (r
12
, r
22
)
asin(r
32
)
atan2 (r
31
, r
33
)
_
_
(415)
u
312
(R
q
(q)) =
_

_
atan2
_
2q
1
q
2
+ 2q
0
q
3
,
q
2
2
q
3
2
+ q
0
2
q
1
2
_
asin
_
2q
2
q
3
2q
0
q
1
_
atan2
_
2q
1
q
3
+ 2q
0
q
2
,
q
3
2
q
2
2
q
1
2
+ q
0
2
_
_

_
(416)
E
312
(, , ) =
_
_
c

0
s

0 1
c

0
_
_
(417)
L{E
312
(, , )} =
_
_
1 0
0 1
1 0
_
_
(418)
E

312
(, , ) =
_
_
0 c

0 s

1 0 s

_
_
(419)
L{E

312
(, , )} =
_
_
0 1
0 1
1 0
_
_
(420)
[E
312
(, , )]
1
=
1
c

_
_
s

0 c

0 c

_
_
(421)
[E

312
(, , )]
1
=
1
c

_
_
s

0
s

0
_
_
(422)
q
312
(, , ) =
_

_
c
/2
c
/2
c
/2
+ s
/2
s
/2
s
/2
c
/2
c
/2
s
/2
+ s
/2
c
/2
s
/2
c
/2
c
/2
s
/2
s
/2
c
/2
s
/2
c
/2
s
/2
s
/2
+ c
/2
c
/2
s
/2
_

_
(423)
R
312

=
_
_
s

+ c

+ c

0 0 0
_
_
(424)
y, y
y
y

z
x

x, x
x
z, z
z
Figure 13: Euler Angle Sequence (3,1,2)
R
312

=
_
_
s

_
_
(425)
R
312

=
_
_
c

+ s

0 c

+ c

0 s

0 c

_
_
(426)
E
312

=
_
_
s

0 0
c

0 0
s

0 0
_
_
(427)
E
312

=
_
_
c

0
0 0 0
c

0
_
_
(428)
E

312

=
_
_
0 s

0 c

0 0 0
_
_
(429)
E

312

=
_
_
0 0 s

0 0 c

0 0 c

_
_
(430)
31
8.10 Euler Angle Sequence (3,1,3)
R
313
(, , ) = R
3
()R
1
()R
3
() =
_
_
c

+ s

+ c

_
_
(431)
L{R
313
(, , )} =
_
_
1 + 0
1
0 1
_
_
(432)
u
313
(R) =
_
_

313
(R)

313
(R)

313
(R)
_
_
=
_
_
atan2 (r
13
, r
23
)
acos (r
33
)
atan2 (r
31
, r
32
)
_
_
(433)
u
313
(R
q
(q)) =
_

_
atan2
_
2q
1
q
3
2q
0
q
2
,
2q
2
q
3
+ 2q
0
q
1
_
acos
_
q
3
2
q
2
2
q
1
2
+ q
0
2
_
atan2
_
2q
1
q
3
+ 2q
0
q
2
,
2q
2
q
3
+ 2q
0
q
1
_
_

_
(434)
E
313
(, , ) =
_
_
s

0
s

0
c

0 1
_
_
(435)
L{E
313
(, , )} =
_
_
0 1 0
0
1 0 1
_
_
(436)
E

313
(, , ) =
_
_
0 c

0 s

1 0 c

_
_
(437)
L{E

313
(, , )} =
_
_
0 1 0
0
1 0 1
_
_
(438)
[E
313
(, , )]
1
=
1
s

_
_
s

0
s

0
s

_
_
(439)
[E

313
(, , )]
1
=
1
s

_
_
s

0
s

0
_
_
(440)
q
313
(, , ) =
_

_
c
/2
c
/2
c
/2
s
/2
c
/2
s
/2
c
/2
c
/2
s
/2
+ s
/2
s
/2
s
/2
c
/2
s
/2
s
/2
s
/2
c
/2
s
/2
c
/2
c
/2
s
/2
+ c
/2
c
/2
s
/2
_

_
(441)
R
313

=
_
_
s

+ c

+ s

0 0 0
_
_
(442)
y
y
y
y

x
z, z

x, x

z, z
x
Figure 14: Euler Angle Sequence (3,1,3)
R
313

=
_
_
s

_
_
(443)
R
313

=
_
_
c

0
s

0
s

0
_
_
(444)
E
313

=
_
_
s

0 0
c

0 0
s

0 0
_
_
(445)
E
313

=
_
_
s

0
s

0
0 0 0
_
_
(446)
E

313

=
_
_
0 s

0 c

0 0 0
_
_
(447)
E

313

=
_
_
0 0 s

0 0 c

0 0 s

_
_
(448)
32
8.11 Euler Angle Sequence (3,2,1)
R
321
(, , ) = R
3
()R
2
()R
1
() =
_
_
c

+ c

+ s

_
_
(449)
L{R
321
(, , )} =
_
_
1
1
1
_
_
(450)
u
321
(R) =
_
_

321
(R)

321
(R)

321
(R)
_
_
=
_
_
atan2 (r
21
, r
11
)
asin(r
31
)
atan2 (r
32
, r
33
)
_
_
(451)
u
321
(R
q
(q)) =
_

_
atan2
_
2q
1
q
2
+ 2q
0
q
3
,
q
1
2
+ q
0
2
q
3
2
q
2
2
_
asin
_
2q
1
q
3
+ 2q
0
q
2
_
atan2
_
2q
2
q
3
+ 2q
0
q
1
,
q
3
2
q
2
2
q
1
2
+ q
0
2
_
_

_
(452)
E
321
(, , ) =
_
_
s

0 1
s

0
c

0
_
_
(453)
L{E
321
(, , )} =
_
_
0 1
1 0
1 0
_
_
(454)
E

321
(, , ) =
_
_
0 s

0 c

1 0 s

_
_
(455)
L{E

321
(, , )} =
_
_
0 1
0 1
1 0
_
_
(456)
[E
321
(, , )]
1
=
1
c

_
_
0 s

0 c

_
_
(457)
[E

321
(, , )]
1
=
1
c

_
_
c

0
c

0
_
_
(458)
q
321
(, , ) =
_

_
c
/2
c
/2
c
/2
s
/2
s
/2
s
/2
c
/2
c
/2
s
/2
+ s
/2
c
/2
s
/2
c
/2
c
/2
s
/2
s
/2
c
/2
s
/2
c
/2
s
/2
s
/2
+ c
/2
c
/2
s
/2
_

_
(459)
R
321

=
_
_
s

+ s

+ c

0 0 0
_
_
(460)
y
y
y, y

x
z

z
x, x
z, z
Figure 15: Euler Angle Sequence (3,2,1)
R
321

=
_
_
c

_
_
(461)
R
321

=
_
_
0 s

+ c

+ c

0 c

0 c

_
_
(462)
E
321

=
_
_
c

0 0
s

0 0
s

0 0
_
_
(463)
E
321

=
_
_
0 0 0
c

0
c

0
_
_
(464)
E

321

=
_
_
0 c

0 s

0 0 0
_
_
(465)
E

321

=
_
_
0 0 c

0 0 s

0 0 c

_
_
(466)
33
8.12 Euler Angle Sequence (3,2,3)
R
323
(, , ) = R
3
()R
2
()R
3
() =
_
_
c

+ s

+ c

_
_
(467)
L{R
323
(, , )} =
_
_
1 +
1 0
0 1
_
_
(468)
u
323
(R) =
_
_

323
(R)

323
(R)

323
(R)
_
_
=
_
_
atan2 (r
23
, r
13
)
acos (r
33
)
atan2 (r
32
, r
31
)
_
_
(469)
u
323
(R
q
(q)) =
_

_
atan2
_
2q
2
q
3
+ 2q
0
q
1
,
2q
1
q
3
+ 2q
0
q
2
_
acos
_
q
3
2
q
2
2
q
1
2
+ q
0
2
_
atan2
_
2q
2
q
3
2q
0
q
1
,
2q
1
q
3
+ 2q
0
q
2
_
_

_
(470)
E
323
(, , ) =
_
_
s

0
s

0
c

0 1
_
_
(471)
L{E
323
(, , )} =
_
_
0
0 1 0
1 0 1
_
_
(472)
E

323
(, , ) =
_
_
0 s

0 c

1 0 c

_
_
(473)
L{E

323
(, , )} =
_
_
0
0 1 0
1 0 1
_
_
(474)
[E
323
(, , )]
1
=
1
s

_
_
c

0
s

0
c

_
_
(475)
[E

323
(, , )]
1
=
1
s

_
_
c

0
c

0
_
_
(476)
q
323
(, , ) =
_

_
c
/2
c
/2
c
/2
s
/2
c
/2
s
/2
c
/2
s
/2
s
/2
+ s
/2
c
/2
s
/2
c
/2
c
/2
s
/2
+ s
/2
s
/2
s
/2
c
/2
c
/2
s
/2
+ c
/2
c
/2
s
/2
_

_
(477)
R
323

=
_
_
s

+ c

+ s

0 0 0
_
_
(478)
y
y, y

x
z,

z, z

x
x
x
z
Figure 16: Euler Angle Sequence (3,2,3)
R
323

=
_
_
c

_
_
(479)
R
323

=
_
_
c

0
s

0
s

0
_
_
(480)
E
323

=
_
_
c

0 0
c

0 0
s

0 0
_
_
(481)
E
323

=
_
_
s

0
s

0
0 0 0
_
_
(482)
E

323

=
_
_
0 c

0 s

0 0 0
_
_
(483)
E

323

=
_
_
0 0 c

0 0 s

0 0 s

_
_
(484)
34
References
[1] Donald T. Greenwood. Principles of Dynamics, Second
Edition. Prentice Hall, Upper Saddle River, NJ, 1988.
[2] Arend L. Schwab. Quaternions, -
nite rotation and euler parameters.
http://tam.cornell.edu/ als93/quaternion.pdf, 2002.
[3] Eric W. Weisstein. Cayley-klein parame-
ters. From MathWorldA Wolfram Web Re-
source. http://mathworld.wolfram.com/Cayley-
KleinParameters.html.
[4] Eric W. Weisstein. Euler angles. From
MathWorldA Wolfram Web Resource.
http://mathworld.wolfram.com/EulerAngles.html.
[5] Eric W. Weisstein. Euler parameters.
From MathWorldA Wolfram Web Resource.
http://mathworld.wolfram.com/EulerParameters.html.
35

You might also like