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 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.

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 Difference 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 ventions. Quaternions, especially unit quaternions and the
axis-angle representation, are discussed in Sec. 6. The ro-
This 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 regard-
to the subject of Euler angles and quaternions, we were un- ing usage and naming conventions are included where ap-
able 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 infor-
gap 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 parametriza-
tion 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 represen- to the object whose attitude we would like to de-
tation is well-suited to integrating the angular velocity of scribe. The origin of this coordinate system is de-
a body over time. The main disadvantages of using unit noted xb .
quaternions are: (1) that the four quaternion parameters
do not have intuitive physical meanings, and (2) that a Points and vectors expressed in the body-fixed coordi-
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,
tion algorithms cannot encode such constraints. xw and x0b are both zero, but x0w and xb are generally not.
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.
quadratic constraint of the unit quaternion. This is not a Some of the mathematics described in this document
new parametrization, but we have found the existing refer- only apply when the world coordinate system is rotation-
ences on this subject to be lacking in detail. The rotation ally fixed. For many purposes, however, it is perfectly ac-
vector 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 coordi-
singularities 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 Overview of Contents


2 Rotation Matrix
In Sec. 1.3 we define the coordinate systems that are used A rotation matrix is a matrix whose multiplication with a
throughout this report. Sec. 2 introduces the idea of rota- vector rotates the vector while preserving its length. The
tion matrices and describes several of their key properties. special orthogonal group of all 3 3 rotation matrices is
Rigid-body kinematics are introduced in Sec. 3. Euler an- denoted by SO(3). Thus, if R SO(3), then
gles are discussed in all their diversity in Sec. 5, including
detailed discussions of the three most commonly-used con- det R = 1 and R1 = RT . (1)

4
Rotation matrices for which det R = 1 are called proper 2.2 Transformation Matrix
and those for which det R = 1 are called improper. Im-
proper 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:
restrict our analysis to proper rotations, as improper rota- 0
x R x0w x
tions are not rigid-body transformations. = (10)
1 0T 1 1
We reference the elements of a rotation matrix as fol-
lows: R Rxb x
= (11)
0T 1 1

R = r1 r2 r3 (2)
T 0
r11 r12 r13 x R xb x
= r21 r22 r23 . (3) = (12)
1 0T 1 1
r31 r32 r33 T
R RT x0w x0
= T . (13)
0 1 1
There are two possible conventions for defining the ro-
tation 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 nec-
The 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 parameteri-
same convention before using results from both sources to-
zations 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 coordi-
provide 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 coordi-
2.1 Coordinate Transformations nates. The two are related to one another through the
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 coordi-
z 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
then the following relations hold: i {1, 2, 3}, are

z0 = R z (4) 1 0 0
R1 () = 0 cos () sin () (14)
z = RT z0 . (5) 0 sin () cos ()

These expression apply to vectors, relative quantities lack- cos () 0 sin ()
ing a position in space. To transform a point from one R2 () = 0 1 0 (15)
coordinate system to the other we must subtract the offset sin () 0 cos ()

to the origin of the target coordinate system before apply- cos () 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 Direction Cosine Matrix
Substituting x = 0 into Eq. 6 and x0 = 0 into Eq. 7 yields
A rotation matrix may also be referred to as a direction
x0w = R xb (8) cosine matrix, because the elements of this matrix are the
cosines of the unsigned angles between the body-fixed axes
xb = RT x0w . (9) and the world axes. Denoting the world axes by (x, y, z)

5
y 2.7 Rotation Matrix Multiplication
y
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 orig-
inal rotation matrices. For example, let
T T
[x1 y1 0] = R3() [x1 y1 0]
z0 = Ra z (19)
y1
x z00 = Rb/a z0 = Rb/a Ra z = Rb z, (20)

y where
1

Rb = Rb/a Ra . (21)
x1
Note that the rotations are applied in the reverse order.
x
z, z x
1
That is, here we apply Ra first, followed by Rb/a .

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


by an angle .
Kinematics is the study of the motion of particles and rigid
bodies, irrespective of the forces and moments involved.
and the body-fixed axes by (x0 , y 0 , z 0 ), let x0 ,y be, for ex- As such, it is the study of the nature of three-dimensional
ample, the unsigned angle between the x0 -axis and the y- space, and falls at least partially into the scope of this
axis. In terms of these angles, the rotation matrix may be report. In this section, we present, without derivation,
written several key results.

cos(x0 ,x ) cos(x0 ,y ) cos(x0 ,z ) 3.1 Notation
R = cos(y0 ,x ) cos(y0 ,y ) cos(y0 ,z ) . (17)
cos(z0 ,x ) cos(z0 ,y ) cos(z0 ,z ) 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
To illustrate this with a concrete example, consider the case
of b with respect to w, and the motion of p with respect to
shown in Fig. 1. Here, x0 ,x = y0 ,y = , x0 ,y = 2 ,
b. We define the relevant terms here.
y0 ,x = 2 + , z0 ,z = 0, and z0 ,{x,y} = {x0 ,y0 },z = 2 .
All of these quantities may be expressed in either the
Expanding Eq. 17,
world coordinates or the body-fixed coordinates, whichever
is more convenient. Body-fixed quantities are noted with
cos(x0 ,x ) cos(x0 ,y ) 0 a prime symbol. Conversions of vectors between the two
R = cos(y0 ,x ) cos(y0 ,y ) 0
coordinate systems are carried out according to Eqs. 4 and
0 0 1 5, and conversions of points are performed with Eqs. 6 and


cos() cos( 2 ) 0 7. All the quantities defined here are vector quantities,
= cos( 2 + ) cos() 0 except xp and xb , which are points.
0 0 1
xb , xb , and xb are the position, velocity, and acceler-
cos() sin() 0 ation of b.
= sin() cos() 0 . (18)
0 0 1 xp , xp , and xp are the position, velocity, and accel-
eration of p.
This is the same result that is presented in Eq. 16 in Sec. xp/b , xp/b , and xp/b are the position, velocity, and
2.4. 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-
2.6 Basis Vectors
eration of b.
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
the basis vectors of the body-fixed coordinates expressed Given these definitions, we consider two main cases.
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
coordinates. to it.

6
3.2 Motion of a Fixed Point on a Rigid Again, we may reconfigure this to yield a more useful final
Body expression:

Let p be rigidly attached to the body, b, such that xp/b =
xp = xb + R C(0 ) + C(0 )2 x0p/b
T
xp/b = 0. The velocity of the point, p, is then

0 0 0
xp = xb + xp/b + xp/b + 2C( )xp/b . (30)
= xb + C() xp/b , (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 R33 is defined by

0 3 2
4 Finite Difference Approximations
C() = 3 0 1 . (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 atti-
tude 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
xp = xb + R xp/b We will discuss a general time-varying vector quantity,
n
= xb + RT C(0 ) x0p/b . (24) z (t) R . Finite difference approximations are denoted
with the operator nS,h , where n is the order of the deriva-
The acceleration of p is tive, S is the stencil over which the finite difference ap-
proximation is computed, and h is the size of the time in-

xp = xb + xp/b + xp/b crement between samples. Finite difference operators are
linear combinations of function evaluations in the neigh-
= xb + 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:
h i 1 X
T 0 0 0 0 0 nS,h z (t0 ) = n ak z (t0 + kh)
xp = xb + R xp/b + xp/b h
kS

= xb + RT C(0 ) + C(0 )2 x0p/b , (26) 1 X
= bk z (t0 + kh) , (31)
c hn
kS
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-
C()2 = 2 1 3 2 1 2 3 2 . (27) nal decomposition. The actual derivative of the function
3 1 3 2 2 2 1 2 is
z(n) (t0 ) = nS,h z (t0 ) + d hm z(n+m) () , (32)
3.3 Motion of a Particle in a Moving Frame
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-
xp = xb + xp/b + xp/b ple, halving the step size produces a fourfold improvement

T 0 0
= xb + R xp/b + xp/b 0 in accuracy for second-order accurate methods but only a
twofold improvement for first-order accurate methods.
T 0 0 0
= xb + R xp/b + C( ) xp/b , (28) Tables 1 and 2 show the finite difference coefficients for
various stencils and orders.
and the acceleration is
angular centripetal 5 Euler Angles
z }| { z }| {
xp = xb + xp/b + xp/b 5.1 Rotation Sequence
+ xp/b + 2 xp/b . (29)
| {z } Three coordinate rotations in sequence can describe any
Coriolis rotation. Let us consider triple rotations in which the first

7
Table 1: Finite difference coefficients over a symmetric
seven-point stencil.
k
m c -3 -2 -1 0 1 2 3 d
First Derivative (bk )
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
Table 2: Finite difference coefficients over a one-sided
3 6 -2 -3 6 -1 1/12
seven-point stencil.
3 6 -11 18 -9 2 -1/4
k
4 12 -1 6 -18 10 3 -1/20 m c 0 1 2 3 4 5 6 d
4 12 1 -8 0 8 -1 1/30
4 12 -3 -10 18 -6 1 -1/20 First Derivative (bk )
5 60 -2 15 -60 20 30 -3 1/60 1 1 -1 1 -1/2
5 60 3 -30 -20 60 -15 2 -1/60 2 2 -3 4 -1 1/3
6 60 -1 9 -45 0 45 -9 1 -1/140 3 6 -11 18 -9 2 -1/4
4 12 -25 48 -36 16 -3 1/5
Second Derivative (bk ) 5 60 -137 300 -300 200 -75 12 -1/6
1 1 1 -2 1 1 6 60 -147 360 -450 400 -225 72 -10 1/7
1 1 1 -2 1 -1
Second Derivative (bk )
2 1 -1 4 -5 2 11/12
2 1 2 -5 4 -1 11/12
2 1 1 -2 1 -1/12
3 12 35 -104 114 -56 11 -5/6
2 1 2 -5 4 -1 11/12
4 12 45 -154 214 -156 61 -10 137/180
3 12 -1 4 6 -20 11 -1/12
3 12 11 -20 6 4 -1 1/12 Third Derivative (bk )
4 12 -1 16 -30 16 -1 1/90 1 1 -1 3 -3 1 -3/2
6 180 2 -27 270 -490 270 -27 2 -1/560 2 2 -5 18 -24 14 -3 7/4
3 4 -17 71 -118 98 -41 7 -15/8
Third Derivative (bk )
4 8 -49 232 -461 496 -307 104 -15 29/15
1 1 -1 3 -3 1 3/2
1 1 -1 3 -3 1 1/2 Fourth Derivative (bk )
1 1 -1 3 -3 1 -1/2 1 1 1 -4 6 -4 1 -2
1 1 -1 3 -3 1 -3/2 2 1 3 -14 26 -24 11 -2 17/6
2 2 1 -6 12 -10 3 1/4 3 6 35 -186 411 -484 321 -114 17 -7/2
2 2 -1 2 0 -2 1 -1/4 Fifth Derivative (bk )
2 2 -3 10 -12 6 -1 1/4 1 1 -1 5 -10 10 -5 1 -5/2
3 4 1 -7 14 -10 1 1 -1/8 2 2 -7 40 -95 120 -85 32 -5 25/6
3 4 -1 -1 10 -14 7 -1 1/8 Sixth Derivative (bk )
4 8 1 -8 13 0 -13 8 -1 7/120 1 1 1 -6 15 -20 15 -6 1 -3
Fourth Derivative (bk )
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 (bk )
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 (bk )
2 1 1 -6 15 -20 15 -6 1 -1/4

8
rotation is an angle about the k-axis, the second rotation
16
is an angle about the j-axis, and the third rotation is an ( sin())/sin()
angle about the i-axis. For notational brevity, let us 14 (1 cos())/cos()
arrange these angles in a three-dimensional vector called
12
the Euler angle vector, defined by

Relative Error [%]


10
T
u := [, , ] . (33)
8
The function that maps an Euler angle vector to its 6
corresponding rotation matrix, Rijk : R3 SO(3), is
4
Rijk (, , ) := Ri ()Rj ()Rk (). (34) 2

As in the general case, if z R3 is a vector in the world 0


0 5 10 15 20 25 30
coordinates and z0 R3 is the same vector expressed in the Angle, [degrees]
body-fixed coordinates, then the following relations hold:
Figure 2: Error in the linearized approximations to the
z0 = Rijk (u) z (35) sine and cosine as a function of the input angle.
z = Rijk (u)T z0 . (36)
5.3 Linearization
5.2 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 con-
The time-derivative of the Euler angle vector is the vector
sider the linearized versions of these functions.
of Euler angle rates. The relationship between the Euler
We consider the case of linearizing about zero. In this
angle rates and the angular velocity of the body is encoded
context, linearization involves substituting:
in the Euler angle rates matrix. Multiplying this matrix
by the vector of Euler angle rates gives the angular veloc- cos() 1 (45)
ity in the global coordinates. Letting ei be the ith unit sin() . (46)
vector, the function that maps an Euler angle vector to its
corresponding Euler angle rates matrix, E : R3 R3x3 , is Higher order terms are then set to zero. These substitu-
tions are valid for small values of . Fig. 2 shows the
Eijk (, , ) := Rk ()T Rj ()T ei , Rk ()T ej , ek , (37) relative error in these approximations as a function of the
input angle. A relative error of 1% is reached in the ap-
and 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 ex-
0
Eijk (, , ) := [ei , Ri ()ej , Ri ()Rj ()ek ] . (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 ro-
tation sequence.
= Eijk (u) u (39) Linearizing about an attitude other than zero is most
0 = Eijk 0
(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) (41) Here, we are considering u0 to be constant, such that the
T 0 product of the two rotation matrices is still linear in the
= Rijk (u) , (42)
parameters of u.
we may eliminate , 0 , and u to yield
0 1 5.4 Valid Rotation Sequences
Rijk (u) = Eijk (u) [Eijk (u)] (43)
T
0 1 Thus far, we have not specified what sequences of coordi-
Rijk (u) = Eijk (u) Eijk (u) . (44) nate rotations are able to span the space of all three di-

9
Table 3: Corresponding quantities between the three most
1 + 0
common Euler angle conventions.
L{R313 (, , )} = 1 . (50)
Rotation Sequence 0 1
(1,2,3) (3,1,3) (3,2,3)
The derivatives of the rotation matrix with respect to the
Euler angles are
2 2

R313
x y x =
y x y

z z z s c c c s s s + c c c c s
x0 z0 z0 c c + s c s c s s c c s s (51)
y0 x0 y 0 0 0 0
0 0
z y x0

s s s s s c s c
R313
mensional rotations. In fact, of the 27 possible sequences = c s s c s c c c (52)
c s c c s
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 R313
=

(i, j, k) (1, 2, 1) , (1, 2, 3), (1, 3, 1) , (1, 3, 2) ,
c s s c c c c s c s 0
(2, 1, 2) , (2, 1, 3) , (2, 3, 1) , (2, 3, 2) , s s c c c
s c c c s 0 . (53)
(3, 1, 2) , (3, 1, 3), (3, 2, 1) , (3, 2, 3) . (48) s c s s 0
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 )
The most common sequence associated with the name Eu- u313 (R) = 313 (R) = acos (r33 ) (54)
ler angles is (3, 1, 3), named for Leonhard Euler, an 18th- 313 (R) atan2 (r 31 , r 32 )
century 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.
In the study of the gyroscopic motion of a spinning rigid 2q 2 q3 + 2q0 q1
u313 (Rq (q)) = acos q
3
2
q 2
2
q 1
2
+ q 0
2
(55)
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 spin-
ning 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
5.5.2 Euler Angles Rotation Matrix E313 (, , ) = s c s 0 (56)
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 () =

c c s c s c s + s c c s s s c 0
s c c c s s s + c c c c s 1 1
(49) [E313 (, , )] = s c s s 0 (58)
s s s c c s s c c c s

10
z, z 5.5.6 Singularities
z, z
This parametrization has singularities at nutation values

of = n for n Z. At these points, changes in spin and
y precession constitute the same motion. This can be most
readily seen in Eq. 56, in which the leading coefficient is
y 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.

y 5.8.

x x
y
5.6 Euler Angle Sequence (1,2,3)
x, x
5.6.1 Usage
Figure 3: Euler Angle Sequence (3,1,3)
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
0 c s s Peter Guthrie Tait, a 19th-century Scottish mathematical
0
E313 (, , ) = 0 s c s (59) physicist; or nautical angles. They are commonly used in
1 0 c aerospace engineering and computer graphics.
Despite the lack of consensus on the issue, these an-
0 1 0 gles are also commonly referred to simply as Euler angles
0
L{E313 (, , )} = 0 (60) in the aeronautics field, in which , , and are known
1 0 1 respectively as roll, pitch, and yaw, or, equivalently, bank,
attitude, and heading.
s c c c s
1 1 Respecting the common and technical usage of these
0
[E313 (, , )] = c s s s 0 . (61)
s s c 0 terms, these angles describe a vehicle whose forward di-
rection is along the positive body-fixed x-axis, with the
The derivatives of the Euler angle rates matrices with re- body-fixed y-axis to starboard, and the body-fixed z-axis
spect to the Euler angles are downward. In such a configuration, the home position,
[, , ] = [0, 0, 0], is flat and level, pointing forward
c s 0 0
E313 along the world x-axis.
= c c 0 0 (62)
s 0 0 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-
s c s 0
E313 quence is to have the y-axis point to port and the z-axis
= s s c 0 (63)
0 0 0 point upward. In this case, a positive change in corre-
sponds to pitching downward.

0 0 s c s
E313
= 0 c s s (64)
0 0 0 5.6.2 Euler Angles Rotation Matrix

0 0 0 s c The function that maps a vector of Euler angles to its
E313 rotation matrix, and that same function linearized, are
= 0 0 c c . (65)
0 0 s
R123 (, , ) = R1 ()R2 ()R3 () =

5.5.5 Euler Angles Unit Quaternion c c c s s
s s c c s s s s + c c c s (67)
The function that maps Euler angles to their corresponding
c s c + s s c s s s c c c
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 1
q313 (, , ) =
c/2 s/2 s/2 s/2 c/2 s/2 . (66) L{R123 (, , )} = 1 . (68)
c/2 c/2 s/2 + c/2 c/2 s/2 1

11
z, z 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
z z

c c s 0
E123 (, , ) = c s c 0 (74)
s 0 1
y
1 0
L{E123 (, , )} = 1 0 (75)
y, y 0 1

x
y
c s 0
x
1 1
[E123 (, , )] = c s c c 0 (76)
c c s s s c

x, x 1 0 s
0
E123 (, , ) = 0 c c s (77)
0 s c c
Figure 4: Euler Angle Sequence (1,2,3)

1 0
The derivatives of the rotation matrix with respect to the 0
L{E123 (, , )} = 0 1 (78)
Euler angles are 0 1
R123
= c s s c s
1 1
0
[E123 (, , )] = 0 c c s c . (79)
0 0 0 c 0 s c
c s c + s s c s s s c c c (69)
s s c + c s s s s c c s c The derivatives of the Euler angle rates matrices with re-
spect to the Euler angles are
c s s s c
R123 c s 0 0
= s c c s c s s s (70) E123
c c c c c s c s = s s 0 0 (80)
c 0 0

R123
= c s c 0
E123
= c c s 0 (81)
c s c c 0
s s s c c 0 0 0
s s c c s 0 . (71)
c s s + s c c s c + s s 0
0 0 0 0
E123
5.6.3 Euler Angles Rotation Matrix = 0 s c c (82)
0 c s c
The inverse mapping, which gives the Euler angles as a
function of the rotation matrix, and the composition of
0 0 0 c
that function with the rotation matrix as a function of the E123
= 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
q3 q2 q1 + q0 c/2 c/2 c/2 + s/2 s/2 s/2
u123 (Rq (q)) =
asin 2q1 q3 2q0 q2
(73)

c/2 s/2 s/2 + c/2 c/2 s/2
atan2 2q1 q2 + 2q0 q3 , q123 (, , ) =
c/2 c/2 s/2 + s/2 c/2 s/2 . (84)

q1 2 + q0 2 q3 2 q2 2 c/2 c/2 s/2 s/2 c/2 s/2

12
5.6.6 Singularities A common strategy for dealing with this problem is to
change representations whenever an object nears a singu-
This 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 de-
represent an objects 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 com-
plications when attempting to optimize over the quater-
5.7 Derivatives of Selected Trigonometric nion parameters. This is due to the fact that a unity norm
Functions constraint is quadratic in form and thus impossible to in-
clude in most standard optimization techniques.
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- 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-
atan(y/x) if x > 0 tween (3, 1, 3) sequence and the (1, 2, 3) sequence are pro-
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.

5.9.1 Sequence (3,1,3) Sequence (1,2,3)


atan2(y, x) y
= 2 (86)
x x + y2 A set of (3, 1, 3) Euler angles may be written as a function
atan2(y, x) x of a set of (1, 2, 3) Euler angles according to
= 2 . (87)
y x + y2
u123
313 (, , ) = u313 (R123 (, , ))

The derivatives of the inverse sine and inverse cosine are atan2 (s , s c )
dasin(x) 1 = acos (c c ) (90)
= (88) atan2 (c s c + s s , c s s + s c )
dx 1 x2
dacos(x) 1 The Jacobian of this function with respect to the (1, 2, 3)
= . (89)
dx 1 x2 Euler angles is

u123 h 123 i
5.8 Singularities 313
= u313 u123
313 u123
313
u
The singularities found in the various Euler angle represen-
c s c s 0
tations are said to arise from gimbal lock. Two examples 1
= as c ac s 0 (91)
of this phenomenon are presented in Secs. 5.5.6 and 5.6.6. a s s c c a
Gimbal lock may be understood in several different
ways. Intuitively, it arises from the indistinguishability of
where
changes in the first and third Euler angles when the second
Euler angle is at some critical value. Take, for example, a := 1 c2 c2 (92)
the (1, 2, 3) sequence. When the pitch angle is 90 degrees,
the vehicle is pointing straight up, and roll and yaw are in- is a repeating term that has been factored for notational
distinguishable. In the case of the (3, 1, 3) sequence, when and computational ease.
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, 5.9.2 Sequence (1,2,3) Sequence (3,1,3)
where it manifests itself as singularities. Again, consider A set of (1, 2, 3) Euler angles may be written as a function
the (1, 2, 3) sequence. In this case, when cos() = 0, then of a set of (3, 1, 3) Euler angles according to
r23 = r33 = r12 = r11 = 0, and the expressions for 123 (R)
and 123 (R) in Eq. 73 are undefined. A similar conse- u313
123 (, , ) = u123 (R313 (, , ))
quence may be observed in the case of the (3, 1, 3) sequence
when sin() = 0. This effect is even more obvious in Eqs. atan2 (c s , c )
56 and 74, where the singularity may be seen directly in = asin (s s ) (93)
the leading coefficient. atan2 (c s + s c c , c c s c s )

13
The Jacobian of this function with respect to the (3, 1, 3) where the skew-symmetric cross product matrix function
Euler angles is C : R3 R33 is defined by
h 313 i
u313 u313 u313 0 x3 x2
123
= u 123 123 123
u
2 C(x) = x3 0 x1 . (105)
1 1 2

a s s c a c c + s 0 x2 x1 0
1b c s 1b s c 0
= (94)
1 2
c c s + c
2
1c c s s 1 6.3 Quaternion Quaternion Matrices
More compactly, quaternion multiplication may be written
where
as the second quaternion pre-multiplied by a matrix-valued
a := c2 + c2 s2 function of the first quaternion. That is,
b := 1 s2 s2 (95) q p = qm (q, p) = Q(q)p = Q(p)q (106)
c := s2 c2 + c2 p q = qm (p, q) = Q(p)q = Q(q)p, (107)
(96)
where the quaternion matrix function, Q : H R44 is
are repeating terms that have been factored for notational defined by
and computational ease.
q0 qT1:3
Q(q) = (108)
q1:3 q0 I3 + C(q1:3 )
6 Quaternions
q0 q1 q2 q3

q q0 q3 q2
= 1 , (109)
Quaternions were first devised by William Rowan Hamil- q2 q3 q0 q1
ton, a 19th-century Irish mathematician. There is a sub- q3 q2 q1 q0
stantial 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 R44 is defined by
representation of the attitude of an object.
q0 qT1:3
Q(q) = (110)
6.1 General Quaternions q1:3 q0 I3 C(q1:3 )

q0 q1 q2 q3
A quaternion, q H, may be represented as a vector, q q0 q3 q2
= 1 . (111)
T q0 q 2 q3 q0 q1
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
of the quaternion, q, are Q(q) = Q(q)T (112)
T
Q(q) = Q(q) . (113)
q0
q = (98)
q1:3 The derivatives of the quaternion multiplication function
q
are
kqk = q02 + q12 + q22 + q32 (99)
q qm (q, p)
q1 = . (100) = Q(p) (114)
kqk q
qm (q, p)
= Q(q). (115)
6.2 Quaternion Multiplication p

Quaternion multiplication is not commutative. Quaternion The derivatives of the quaternion matrix functions with
multiplication between quaternions q and p is defined by respect to the parameters of the quaternion are

q p = qm (q, p) (101) 1 0 0 0 0 1 0 0
Q 0 1 0 0 Q 1 0 0 0
q0 p0 qT1:3 p1:3 = , = , (116)
= (102) q0 0 0 1 0 q1 0 0 0 1
q0 p1:3 + p0 q1:3 q1:3 p1:3
0 0 0 1 0 0 1 0
q0 qT1:3 p0
0 0 1 0

0 0 0 1

= (103)
q1:3 q0 I3 C(q1:3 ) p1:3 Q
0 0 0 1 Q 0 0 1 0
= , = . (117)
p0 pT1:3 q0 q2 1 0 0 0 q3 0 1 0 0
= , (104)
p1:3 p0 I3 + C(p1:3 ) q1:3 0 1 0 0 1 0 0 0

14

1 0 0 0 0 1 0 0 6.5 Unit Quaternion Rotation Matrix
Q 0 1 0 0 Q 1 0 0 0
= , = , (118)
q0 0 0 1 0 q1 0 0 0 1 The reverse mapping, from a rotation matrix to a quater-
0 0 0 1 0 0 1 0 nion, is slightly more complicated. Inspection of Eq. 125
yields the following relations:
0 0 1 0 0 0 0 1
Q 0 0 0 1 Q 0 0 1 0 4q02 = 1 + rq11 (q) + rq22 (q) + rq33 (q) (131)
= , = . (119)
q2 1 0 0 0 q3 0 1 0 0
0 1 0 0 1 0 0 0 4q12 = 1 + rq11 (q) rq22 (q) rq33 (q) (132)
4q22 = 1 rq11 (q) + rq22 (q) rq33 (q) (133)
6.4 Unit Quaternion Rotation Matrix 4q32 = 1 rq11 (q) rq22 (q) + rq33 (q) (134)
Unit quaternions are quaternions with unity norm. Through-
out this section, we assume that 4q2 q3 = rq23 (q) + rq32 (q) (135)
4q1 q3 = rq31 (q) + rq13 (q) (136)
kqk = 1. (120)
4q1 q2 = rq12 (q) + rq21 (q) (137)
A unit quaternion can be used to represent the attitude 4q0 q1 = rq23 (q) rq32 (q) (138)
of a rigid body. Consider a vector z R3 in the global 4q0 q2 = rq31 (q) rq13 (q) (139)
coordinates. If z0 R3 is the same vector in the body-
4q0 q3 = rq12 (q) rq21 (q). (140)
fixed coordinates, then the following relations hold:
From these we arrive at four different inverse mappings.
0 0
= q q1 (121) These are qiR : SO(3) H for i {0, 1, 2, 3}, defined by
z0 z
1
0 (1 + r11 + r22 + r33 ) 2
=q q (122)
z 1 (r23 r32 )/(1 + r11 + r22 + r33 ) 2
1

q0R (R) = (141)


2 (r31 r13 )/(1 + r11 + r22 + r33 ) 2
1
0
= Q(q)T Q(q) (123) 1
z (r12 r21 )/(1 + r11 + r22 + r33 ) 2

1 0T 0
= , (124)
0 Rq (q) z 1
(r23 r32 )/(1 + r11 r22 r33 ) 2
1
1
where (1 + r11 r22 r33 ) 2
q1R (R) = (142)
2 (r12 + r21 )/(1 + r11 r22 r33 )
1
2
1
Rq (q) = (125) (r31 + r13 )/(1 + r11 r22 r33 ) 2
2 2 2 2

q0 + q1 q2 q3 2q1 q2 + 2q0 q3 2q1 q3 2q0 q2
2q1 q2 2q0 q3 q02 q12 + q22 q32 2q2 q3 + 2q0 q1 . 1

2q1 q3 + 2q0 q2 2q2 q3 2q0 q1 q02 q12 q22 + q32 (r31 r13 )/(1 r11 + r22 r33 ) 2
1 (r12 + r21 )/(1 r11 + r22 r33 ) 2
1

q2R (R) = (143)


2
1
That is, (1 r11 + r22 r33 ) 2
1
(r23 + r32 )/(1 r11 + r22 r33 ) 2
z0 = Rq (q)z (126)
T 0
z = Rq (q) z . (127) 1
(r12 r21 )/(1 r11 r22 + r33 ) 2
1 (r31 + r13 )/(1 r11 r22 + r33 ) 2
1
Just as with rotation matrices, sequences of rotations are q3R (R) = . (144)
2 (r23 + r32 )/(1 r11 r22 + r33 ) 2
1
represented by products of quaternions. That is, for unit
1
quaternions q and p, it hods that (1 r11 r22 + r33 ) 2

Rq (q p) = Rq (q)Rq (p). (128) Depending on the values of R, some of these functions


will produce complex results. To avoid such an event, we
The derivatives of the rotation matrix function with re- define the following composite function, which selects the
spect to the quaternion parameters are best of these four, depending on the parameters of R. The
function, qR : SO(3) H, is
q0 q3 q2 q1 q2 q3
Rq Rq
= 2q3 q0 q1 , = 2q2 q1 q0 , (129) qR (R) :=
q0 q2 q1 q0 q1 q3 q0 q1 0
q (R) if r22 > r33 , r11 > r22 , r11 > r33
R
Rq
q2 q1 q0
Rq
q3 q0 q1 q1R (R) if r22 < r33 , r11 > r22 , r11 > r33
(145)
= 2 q1 q2 q3 , = 2q0 q3 q2 . (130) q2R (R) if
r22 > r33 , r11 < r22 , r11 < r33
q2 q3
q q q
0 3 2 q 1 q2 q3 q3R (R) if r22 < r33 , r11 < r22 , r11 < r33 .

15
6.6 Quaternion Rates Angular Velocity More compactly:
The time derivative of the unit quaternion is the vector of 1
quaternion rates. The quaternion rates, q, are related to q (q, ) = W (q)T (158)
2
the angular velocity. The functions that map a unit quater- 1
nion and its temporal derivative to the angular velocity in q0 (q, 0 ) = W 0 (q)T 0 . (159)
4 3
2
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
= 2q q = 2Q(q)T q. (147) of the quaternion parameters by
0q (q, q)

More compactly: 0 kqk2
= 2q q + 2 (160)
0

q (q, q) := 2W (q)q (148) T kqk2
= 2Q(q) q + 2 (161)
0q (q, q) := 2W 0 (q)q, (149) 0

where the quaternion rates matrices, W : H R34 and


W 0 : H R34 , are defined by 0 kqk2
= 2q q + 2 (162)
0 0
q1 q0 q3 q2
T kqk2
W (q) := q2 q3 q0 q1 (150) = 2Q(q) q + 2
0
. (163)
q3 q2 q1 q0

q1 q0 q3 q2 More compactly:
W 0 (q) := q2 q3 q0 q1 . (151)
q3 q2 q1 q0 q (q, q) := 2W (q)q (164)
0q (q, q) := 2W 0 (q)q. (165)
The derivatives of the quaternion rates matrices with re-
spect to the parameters of the quaternion are
6.9 Quaternion Rates Angular Acceler-

0 1 0 0 1 0 0 0 ation
W W
= 0 0 1 0 , = 0 0 0 1 , (152) The inverse mappings, from the angular acceleration rates
q0 0 0 0 1 q1 0 0 1 0
to the second derivative of the quaternion, are
0 0 0 1 0 0 1 0
W W 1
= 1 0 0 0 , = 0 1 0 0 , (153) q (q, ) := W (q)T (166)
q2 0 1 0 0 q3 1 0 0 0 2
1
q0 (q, 0 ) := W 0 (q)T 0 . (167)
2
0 1 0 0 1 0 0 0
W 0 W 0
= 0 0 1 0 , = 0 0 0 1 , (154) 6.10 Unit Quaternion Cayley-Klein Pa-
q0 q 1
0 0 0 1 0 0 1 0 rameters

0 0 0 1 0 0 1 0 The Cayley-Klein parameters are closely related to the unit
W 0 W 0
= 1 0 0 0 , = 0 1 0 0 , (155) quaternion. Consequently we will give it only brief mention
q2 0 1 0 0 q3 1 0 0 0 here. The Cayley-Klein parameters are , , , and C.
These parameters are often arranged as a 2 2 matrix,
6.7 Quaternion Rates Angular Velocity

The inverse mapping, from the angular velocity and the K := , (168)

unit quaternion to the quaternion rates, is closely related.
The functions q : H R3 R4 and q0 : H R3 R4 and satisfy the constraints

+ = 1, + = 1, (169)
1 0 1 0
q (q, ) = q = Q(q) (156) + = 0, + = 1, (170)
2 2
= , and = , (171)
0 1 0 1 0
q0 (q, ) = q = Q(q) . (157)
2 0 2 0 where is the complex conjugate of .

16
The function that maps the Cayley-Klein parameters The corresponding quaternion matrices are given by the
to their corresponding unit quaternion, qK : C22 H, is functions Qa : R S2 R44 and Qa : R S2 R44 ,
1 where
2 ( + )
i ( + ) Qa (, n) = Q(qa (, n)) (179)
qK = 1 ( ) .
2 (172)
2 c 2 n1 s 2 n2 s 2 n3 s 2
i n1 s
2 ( ) c 2 n3 s 2 n2 s 2
= 2
n2 s n3 s

(180)
2 2
c 2 n1 s 2
The function that maps the Cayley-Klein parameters to n3 s 2 n2 s 2 n1 s 2 c 2
their corresponding rotation matrix, Rc : C22 SO(3),
is Qa (, n) = Q(qa (, n)) (181)

RK = (173) c 2 n1 s 2 n2 s 2 n3 s 2
1 n1 s c 2 n3 s 2 n2 s 2
i = 2 . (182)
2 ( + ) 2 ( + + ) ( ) n2 s n3 s
2 2 2 2 2 2 2 2
c 2 n1 s 2
i (2 2 + 2 2 ) 1 (2 + 2 + 2 +2 ) i (+) . 2 2
n3 s 2 n2 s 2 n1 s 2 c 2
2 2
( ) i (+) (+ )
The corresponding rotation matrix is given by the function
Ra : R S2 SO(3), define by
6.11 Unit Quaternion Cayley-Klein Pa-
rameters Ra (, n) = Rq (qa (, n)) (183)

The inverse mapping is Kq : H C22 , defined by = ra1 (, n) ra2 (, n) ra3 (, n) , (184)
the columns of which read
q (q) q (q) q0 + iq3 iq1 + q2
Kq (q) = = . (174) 2
q (q) q (q) iq1 q2 q0 iq3 n1 n3 2 n2 2 s 2 2 + c 2 2
ra1 (, n) = 2n1 n2 s 2 2 2n3 c 2 s 2 (185)
Other relationships involving Cayley-Klein parameters, 2n1 n3 s 2 2 + 2n2 c 2 s 2
such as those between the Cayley-Klein parameters and
2
22n1 n2 s2 2 + 22n 3 c 22 s 2 2

the Euler angles may be derived from Eq. 172 through
ra2 (, n) = n2 n3 n1 s 2 + c 2 (186)
composition with the appropriate functions in Sec. 6 or
Sec. 8. 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 .
6.12 Unit Quaternion Axis-Angle 1 c 22 s 2 2 (187)

2 2 2
n3 n2 n1 s 2 + c 2

Any finite rotation may be achieved by a single rotation


about an appropriately chosen axis. It is therefore possi- This representation, while perhaps more intuitive than
ble to parameterize the attitude of a rigid body with an the quaternion, is functionally equivalent to it: both re-
angle R and a unit vector n S2 , where S2 := {v quire four parameters and a single quadratic constraint.
R3 | kvk = 1}. The quaternion that arises from a rotation In order to overcome this problem, and produce a quater-
about an axis n is given by the axis-angle quaternion nion representation that requires only three parameters,
function, qa : R S2 H, define by we will continue this development in Sec. 7.
Before moving on from the axis-angle representation,
cos 12 we present some derivatives of key results. Differentiating
qa (, n) := . (175)
n sin 12 Eqs. 181-187 with respect to and n yields
1
Here, we emphasize that we are constrained to consider ra1 2 s 1 n 1 2 + n 2 2 + n 3 2
only vectors n that satisfy the quadratic norm constraint, = n1 n2 s n3 c (188)
n1 n3 s + n2 c
knk = 1. Differentiating with respect to and n yields
1
qa 2 sin 12 n1 n2 s + n3 c
= 1 (176) r a2
1 = 21 s 1 + n1 2 n2 2 + n3 2 (189)
2 n cos 2 n2 n3 s n1 c

qa 0T n1 n3 s n2 c
ra3
=
I3 sin 12
(177) = n2 n3 s + n1 c
(190)
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 . (178) Ra
0 s 2 0 = n2 (1 c ) n1 (1 c ) s (191)
0 0 s 2 n1 n3 (1 c ) s n1 (1 c )

17
6.15 Unit Quaternion Euler Angles
n2 (1 c ) n1 (1 c ) s
Ra
= n1 (1 c ) n2 (1 c ) n3 (1 c ) (192) The inverse mapping, from a unit quaternion to a set of
n2 s n3 (1 c ) n2 (1 c ) Euler angles, is uijk (Rq (q)). These results are presented
with each Euler angle set in Sec. 8.

n3 (1 c ) s n1 (1 c )
Ra
= s n3 (1 c ) n2 (1 c ) (193)
n3 n1 (1 c ) n2 (1 c ) n3 (1 c ) 6.16 Optimization with Quaternions
Because of their simplicity, mathematical elegance, and
t/2 n1 n2 n3 lack of any singularities, quaternions are a very popular
Qa c/2
n1 t/2 n3 n2
representation for encoding the attitude of a rigid body.
= (194)
2 n2 n3 t/2 n1 This includes applications in which quaternions are in-
n3 n2 n1 t/2 cluded as state variables in an optimization. In these cases,
the difficult problem of how to impose the unity norm con-
t/2 n1 n2 n3 straint arises. Various techniques are used to solve this
Qa c/2
n1 t/2 n3 n2 problem, though none of them are completely satisfactory.
= (195)
2 n2 n3 t/2 n1 For iterative optimization algorithms, such as the con-
n3 n2 n1 t/2 jugate gradient algorithm, it is possible to simply re-normalize
the quaternions after each iteration. When using a direct
Qa Q method, however, this strategy is usually insufficient. In
= sin , and (196) 2
ni 2 qi such cases, terms of the form c (1 kqk) are also included
Qa Q in the objective function to prevent large violations of the
= sin , for i {1, 2, 3}. (197) constraint. Renormalization after each iteration is usually
ni 2 qi
still necessary.
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 7 Rotation Vector Representation
in Eqs. 116-118.
One of the major drawbacks of quaternions is that they re-
quire a quadratic norm constraint in order to be valid rota-
6.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 sev-
responding axis and angle of rotation, are q : H R and eral ways in which to do this, but we present what appears
nq : H S2 , defined by to be the most natural three-dimensional parametrization
of the quaternion representation of an objects attitude.
q (q) := 2acos(q0 ) (198)
q1:3 q1:3
nq (q) := =p . (199) 7.1 Rotation Vector Axis-Angle
kq1:3 k 1 q02
We define the rotation vector as a function of the axis and
6.14 Unit Quaternion Euler Angles angle of a rotation, va : R S 2 R3 , by
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 (, ei ) qa (, ej ) qa (, ek ). (200) the functions v : R3 R and nv : R3 S2 , defined by

Differentiating with respect to the Euler angles yields v (v) := kvk = v (205)
v v
qijk (, , ) qa nv (v) := = . (206)
= qa (, ej ) qa (, ek ) (201) kvk v
,ei

qijk (, , ) qa Here we have used the shorthand,
= qa (, ei ) qa (, ek ) (202)
,ej
v := kvk. (207)
qijk (, , ) qa
= qa (, ei ) qa (, ej ) . (203)
,ek This will be used throughout this article.

18
7.3 Rotation Vector Unit Quaternion
We define the function that maps a rotation vector to a
0 1 0 v1 v2 v22 v2 v3
unit quaternion, qv : R3 H, by G s v2 0 0 0 a 2v2 2v1 0
= + 3 2v

cos v2 v2 2v 0 0 0 4v 1 6v2 2v3
qv (v) := qa (v (v), nv (v)) = v v (208) 0 0 0 0 2v3 2v2
v sin 2
0 0 0
2
v2 b v v1 v2 v1 v3
1 + 5 1 (219)
lim qv (v) = lim 1 . (209) 4v v1 v2 v22 v2 v3
v0 v0 2v v1 v3 v2 v3 v32

The derivatives of qv 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 0 0 1 v1 v3 v2 v3 v32
following two quantities: G s 2 0 0 0
v a 2v3 0 2v1
= + 3 0
v3 2v 0 0 0 4v 2v3 2v2
a := c v2 v 2s v2 (210) 0 0 0 2v1 2v2 6v3
2
b := s v2 v 6c v2 v + 12s v2 . (211)
0 0 0
v3 b v 2 v1 v2 v1 v3
We differentiate Eq. 208 to yield + 5 1 . (220)
4v v1 v2 v22 v2 v3
2
G(v) = [ g1 (v), g2 (v), g3 (v) ] v1 v3 v2 v3 v3

qv qv qv qv
:= = , ,
v v1 v2 v3 7.4 Rotation Vector Unit Quaternion
T T
s v v a 0
= 2 + 3 (212) The inverse mapping, vq : H R3 , which maps a unit
2v 2I3 2v vvT quaternion to a rotation vector, is defined by

v1 v2 v3 0 0 0
s 2
v
0 0 2
a v1 v1 v2 v1 v3 vq (q) := q (q)nq (q) (221)
= 2 + (213)
2v 0 2 0 2v 3 v1 v2 v2 2 v2 v3 q1:3
0 0 2 v1 v3 v2 v3 v3 2 = 2 acos(q0 ) (222)
kq1:3 k
2 v 2 v

v1 v s 2 v2 v s 2 v3 v 2 s v2 2 acos(q0 )
1 2v 2 s v2 + v1 2 a v 1 v2 a v 1 v3 a = 1 q1:3 (223)
= 3 2 v 2
(214)
(1 q02 ) 2
2v v1 v2 a 2v s 2 + v2 a v 2 v3 a
2 v 2
v1 v3 a v2 v3 a 2v s 2 + v3 a
lim vq (q) = 2q1:3 (224)
kq1:3 k0
v1 v2 v3
1 2 0 0
lim G(v) = (215)
v0 4 0 2 0 1
0 0 2 c := (225)
1 q0 2
acos (q0 )
G s v2 eTi a vi vT
d := p (226)
= + 3 1 q0 2
vi 2v 033 4v 2 ei vT + veTi + vi I3
T
vi b 0
+ 5 (216)
4v vvT 2cq1 (dq0 1) 2d 0 0
vq
H(q) := = 2cq2 (dq0 1) 0 2d 0 (227)
q 2cq3 (dq0 1) 0 0 2d
G 1 eTi
lim = (217)
v0 vi 4 033

2 0 2 0 0
1 0 0 v1 v1 v2 v1 v3 lim H(q) = 0 0 2 0 . (228)
G s 2 0 0 0
v a 6v1 2v2 2v3 kq1:3 k0
0 0 0 2
= + 3 2v
v1 2v 0 0 0 4v 2 2v1 0
0 0 0 2v3 0 2v1
7.5 Rotation Vector Quaternion Matri-
0 0 0
v1 b v12 v1 v2 v1 v3 ces
+ 5 (218)
4v v1 v2 v22 v2 v3 The quaternion matrices may be written as a function of
2
v1 v3 v2 v3 v3 the rotation vector by composition of Eqs. 108 and 110,

19
and Eq. 208: Wv0 (v) := W 0 (qv (v))

v1 s v2 vc v2 v3 s v2 v2 s v2
Qv (v) := Q(qv (v)) 1
= v2 s v v3 s v vc v v1 s v (238)
vc v2 v1 s v2 v2 s v2 v3 s v2 v v s v2 v s v 2 v 2s v vc v2
3 2 2 2 1 2
1 v 1 s v2 vc v2 v3 s v2 v2 s v2 2

= (229)
v v2 s v2 v3 s v2 vc v2 v1 s v2
v1 2 v3 v2
v3 s v2 v2 s v2 v1 s v2 vc v2 1
lim Wv (v) = v2 v3 2 v1 (239)
v0 2 v v v 2
3 2 1
Qv (v) := Q(qv (v))
v1 2 v3 v2
vc v2 v1 s v2 v2 s v2 v3 s v2 1

1 v1 s v2 vc v2 v3 s v2 v2 s v2 lim Wv0 (v) = v2 v3 2 v1 . (240)
= (230) v0 2 v v v 2

v v2 s 2 v3 s 2 vc 2
v v
v
v1 s v2 3 2 1

v3 s 2 v2 s 2 v1 s 2 vc v2
v v v
The derivatives of the quaternion rates matrices with re-
spect to the rotation vector parameters are
3 3
2 v1 v2 v3 Wv X W qvi X W
1 v 2 v3 v2 = = gij (v)
lim Qv (v) = 1 (231) vj qi vj qi
v0 2 v 2 v 3 2 v1 i=0 i=0
v3 v2 v1 2 = W (gj (v)) (241)

3
X W 0 qvi X W 0 3
2 v1 v2 v3 Wv0
= = gij (v)
1 v 2 v3 v2 vj qi vj qi
lim Qv (v) = 1 . (232) i=0 i=0
v0 2 v2 v3 2 v1
= W 0 (gj (v)) . (242)
v3 v2 v1 2

The derivatives of the quaternion matrices with respect to 7.7 Rotation Vector Rotation Matrix
the rotation vector parameters are
The rotation matrix may be written as a function of the
3
X 3
X rotation vector by composition of Eqs. 125 and 208:
Qv Q qvi Q
= = gij (v)
vj qi vj qi Rv (v) := Rq (qv (v))
i=0 i=0
= Q (gj (v)) (233) = rv1 (v) rv2 (v) rv3 (v) , (243)
the columns of which read
2
Qv 1 Qv v1 v22 v32 s2v + v 2 c2v
lim = (234) 1 2 2
v0 vj 2 qj rv1 (v) = 2 2s v2 v1 v2 s v2 vv3 c v2 (244)
v
2s v2 v1 v3 s v2 + vv2 c v2

Qv
3
X Q qvi X Q3
2s v2 v1 v2 s v2 + vv3 c v2
= = gij (v) 1
vj qi vj qi rv2 (v) = 2 v22 v32 v12 s2v2 + v 2c2v2 (245)
i=0 i=0 v
2s v2 v2 v3 s v2 vv1 c v2
= Q (gj (v)) (235)
2s v2 v1 v3 s v2 vv2 c v2
1
rv3 (v) = 2 2s v2 v2 v3 s v2 + vv1 c v2 . (246)
Qv 1 Qv v v32 v12 v22 s2v + v 2 c2v
lim = . (236) 2 2
v0 vj 2 qj
For very small v, we have:

7.6 Rotation Vector Quaternion Rates 1 v3 v2
Matrices lim Rv (v) = v3 1 v1 . (247)
v0
v2 v1 1
The quaternion rates matrices may be written as a function
of the rotation vector by composition of Eqs. 150 and 151, The derivatives of the rotation matrix with respect to the
and Eq. 208: parameters of the rotation vector are
Rv h i
Wv (v) := W (qv (v)) = r v1
vj
rv2
vj
rv3
vj
vj
v1 s v2 vc v2 v3 s v2 v2 s v2 3
1 X Rq qvi
= v2 s v2 v3 s v2 vc v v1 s v2 (237) = . (248)
v v s v v s v v s2v vc v2

qi qv (v) vj
3 2 2 2 1 2 i=0

20
where 7.10 Rotation Vector Rates Angular Ve-
rvi locity
= Fi (qv (v)) gj (v) (249)
vj 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
q0 q1 q2 q3
rotation vector and its temporal derivative to the angular
F1 (q) = q3 q2 q1 q0 (250)
velocity in world and body-fixed coordinates are v : R3
q2 q3 q0 q1
R3 R3 and 0v : R3 R3 R3 , defined by
q3 q2 q1 q0
F2 (q) = q0 q1 q2 q3 (251) v (v, v) := 2Wv (v)qv (v)
q1 q0 q3 q2 = 2Wv (v)G(v)v

q2 q3 q0 q1 = 2V (v)v (259)
F3 (q) = q1 q0 q3 q2 (252) 0v (v, v) := 2Wv0 (v)qv (v)
q0 q1 q2 q3 = 2Wv0 (v)G(v)v
= 2V (v)T v, (260)
Rv
lim = C(ei ) (253) where the rotation vector rates matrix, V : R3 R33 , is
v0 vj
defined by

0 0 0 0 0 1 V (v) := Wv (v)G(v), (261)
Rv Rv
lim = 0 0 1 , lim = 0 0 0 ,
v0 v1 v0 v2 where Wv (v) and G(v) are defined in Eqs. 237 and 212.
0 1 0 1 0 0
As it also holds that 0 = Rv (v), we have that
0 1 0
Rv
lim = 1 0 0 . (254) Rv (v) = V (v)T V (v)1 (262)
v0 v3
0 0 0 T
Rv (v) = V (v)V (v) T
. (263)

7.8 Rotation Vector Multiplication 7.11 Rotation Vector Rates Angular Ve-
The multiplication of two rotation vectors u and v R3 is locity
defined in terms of the product of quaternions:
The functions that map the angular velocity in the body-
v u = vm (v, u) = vq (qm (qv (v), qv (u))) . fixed and world coordinates to the rotation vector rates,
(255)
v : R3 R3 R3 and v0 : 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)
vector. 2
The derivatives of the rotation vector multiplication 1
v0 (v, 0 ) = V (v)T 0 . (265)
function are 2

vm(v,u) 7.12 Integration of Angular Velocity


= H(qm (qv (v), qv (u)) Q (qv (u)) G(v) (256)
v
vm(v,u) Quaternions are very well suited to tracking the attitude
= H(qm (qv (v), qv (u)) Q (qv (v)) G(u). (257) of an object by integrating the body-fixed angular velocity
u
over time.
Here, H(q), Q(q), and G(v) are given in Eqs. 227 , 110, Consider an object with a body-fixed angular velocity
and 212. of 0 (t). Let us consider the change in attitude from time
t0 to time t1 . We define the rotation vector over this in-
terval to be
7.9 Rotation Vector Rates Quaternion
Z t1
Rates
v0 (t0 , t1 ) := 0 (t) dt. (266)
The quaternion rates as a function of the rotation vector t0
3 4
rates are given in the function qv : 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 inte-
qv v gration will have to be carried out numerically. The sim-
qv (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 v0 (t0 , t1 )] q0
= qv (v0 (t0 , t1 )) q0 . (267)

This equation may be easily generalized to read

qi+1 = qv (v0 (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 Param-


eterizations
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 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) z z

R121 (, , ) = R1 ()R2 ()R1 () = z



c s s s c y
s s c c s c s c s + s c c (269) z
c s s c c c s s s + c c c
y, y
1 0
L{R121 (, , )} = 0 1 + (270)
1

121 (R) atan2 (r21 , r31 )
u121 (R) = 121 (R) = acos (r11 ) (271)
121 (R) atan2 (r12 , r13 ) x, x
y

atan2 2q1 q2 2q0 q3 ,

2q 1 q3 + 2q0 q2
2 2 2
u121 (Rq (q)) = acos q1 + q0 q3 q2 2
(272)
atan2 2q1 q2 + 2q0 q3 ,
x, x
2q1 q3 + 2q0 q2

c 0 1 Figure 5: Euler Angle Sequence (1,2,1)
E121 (, , ) = s s c 0 (273)
s c s 0
s c s c c
R121
= s c s s s s s c (281)
1 0 1 c c c s s c s c
L{E121 (, , )} = 0 1 0 (274)
0
R121
=

1 0 c
0
E121 (, , ) = 0 c s s (275) 0 s c s s
0 s c s 0 c s s c c c c s c s (282)
0 s s c c c s c c c s

1 0 1
0
L{E121 (, , )} = 0 1 0 (276) E121
s 0 0
0 = c s 0 0 (283)
c c 0 0

0 s c
1 1
[E121 (, , )] = 0 s c s s (277) E121
0 0 0
s s c s c c = s c s 0 (284)
s s c 0

s s c c c
1 1
0
[E121 (, , )] = 0 c s s s (278) 0
E121
0 0 0
s 0 s c = 0 s c s (285)
0 c s s

c/2 c/2 c/2 s/2 c/2 s/2
c/2 c/2 s/2 + c/2 c/2 s/2 0 0 s
q121 (, , ) =
c/2 c/2 s/2 + s/2 s/2 s/2 (279) 0
E121
= 0 0 s c (286)
c/2 s/2 s/2 s/2 c/2 s/2 0 0 c c

R121
=


0 0 0
c s s c c c s s s + c c c (280)
s s c c + s c s c s s c c

23
8.2 Euler Angle Sequence (1,2,3) z, z

R123 (, , ) = R1 ()R2 ()R3 () = z z



c c c s s
s s c c s s s s + c c c s (287)

c s c + s s c s s s c c c
y
1
L{R123 (, , )} = 1 (288)
1 y, y


x
123 (R) atan2 (r23 , r33 ) y
x
u123 (R) = 123 (R) = asin (r13 ) (289)
123 (R) atan2 (r12 , r11 )

atan2 2q2 q3 + 2q0 q1 ,
2 2 2 2
q3 q2 q1 + q0
x, x


u123 (Rq (q)) = asin 2q1 q3 2q0 q2 (290)

atan2 2q1 q2 + 2q0 q3 , Figure 6: Euler Angle Sequence (1,2,3)
2 2 2 2

q1 + q0 q3 q2

c c s 0 c s s s c
R123
E123 (, , ) = c s c 0 (291) = s c c s c s s s (299)
c c c c c s c s
s 0 1
R123
1 0 =
L{E123 (, , )} = 1 0 (292)


0 1 c s c c 0
s s s c c s s c c s 0 (300)
1 0 s c s s + s c c s c + s s 0
0
E123 (, , ) = 0 c c s (293)

0 s c c c s 0 0
E123
= s s 0 0 (301)
1 0 c 0 0
0
L{E123 (, , )} = 0 1 (294)

0 1 c s c 0
E123
= c c s 0 (302)
c s 0 0 0 0
1 1
[E123 (, , )] = c s c c 0 (295)
c
c s s s c 0 0 0 0
E123
= 0 s c c (303)
c s s c s 0 c s c
1 1
0
[E123 (, , )] = 0 c c s c (296)
c 0 s c
0 0 0 c
E123
= 0 0 s s (304)
c/2 c/2 c/2 + s/2 s/2 s/2 0 0 c s
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

R123
=


0 0 0
c s c + s s c s s s c c c (298)
s s c + c s s s s c c s c

24
8.3 Euler Angle Sequence (1,3,1) z y

z, z

y
R131 (, , ) = R1 ()R3 ()R1 () =

c c s s s z y
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 0
L{R131 (, , )} = 1 + (306) y
0 1
x, x

131 (R) atan2 (r31 , r21 )
u131 (R) = 131 (R) = acos (r11 ) (307)
131 (R) atan2 (r13 , r12 ) x, x


atan2 2q1 q3 + 2q0 q2 , Figure 7: Euler Angle Sequence (1,3,1)

2q 1 q2 + 2q0 q3
2 2 2
u131 (Rq (q)) = acos q1 + q0 q3 q2 2
(308)
atan2 2q1 q3 2q0 q2 , s c c c s
R131
= c c c s c c s s (317)
2q1 q2 + 2q0 q3 s c s s c s s s

c 0 1
R131
E131 (, , ) = c s s 0 (309) =
s s c 0

0 s s s c
0 c c s s c
1 0 1 c c c s s (318)
L{E131 (, , )} = 0 (310) 0 s c s c c s c c c s
0 1 0
s 0 0
E131
1 0 c = c c 0 0 (319)

0
E131 (, , ) = 0 s c s (311) c s 0 0
0 c s s
0 0 0
E131
1 0 1 = s s c 0 (320)

0
L{E131 (, , )} = 0 (312) s c s 0
0 1 0
0 0 0 0
E131
0 c s = 0 c s s (321)
1 1
[E131 (, , )] = 0 s s s c (313) 0 s c s
s s c c c s
0 0 0 s
E131
s
1
c c s c = 0 0 c c (322)
0
[E131
1
(, , )] = 0 s s c s (314) 0 0 s c
s 0 c s

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

R131
=


0 0 0
s s s c c c s s c s + c c (316)
c s c c c + s s c c s s c

25
8.4 Euler Angle Sequence (1,3,2) z

R132 (, , ) = R1 ()R3 ()R2 () = z, z



c c s c s z
c s c + s s c c c s s + s c (323) y
s s c + c s s c s s s + c c

1
y
L{R132 (, , )} = 1 (324)
1


132 (R) atan2 (r32 , r22 ) x
u132 (R) = 132 (R) = asin (r12 ) (325)
y, y
132 (R) atan2 (r13 , r11 )

atan2 2q2 q3 + 2q0 q1 ,
2 2 2 2
q2 q3 + q0 q1

u132 (Rq (q)) = asin 2q x
1 q2 + 2q0 q3 (326) x, x
atan2 2q1 q3 + 2q0 q2 ,
2 2 2 2

q1 + q0 q3 q2 Figure 8: Euler Angle Sequence (1,3,2)

c c s 0
E132 (, , ) = s 0 1 (327) s c c s s
R132
c s c 0 = c c c c s c c s (335)
s c c s s s c s

1 0
L{E132 (, , )} = 0 1 (328) R132
=
1 0

c s 0 c c
1 0 s c s s + s c 0 c s c s s (336)
0
E132 (, , ) = 0 s c c (329) s s s + c c 0 s s c c s
0 c s c

s c 0 0
1 0 E132
= c 0 0 (337)
0
L{E132 (, , )} = 0 1 (330) s s 0 0
0 1

c s c 0
c 0 s E132
1 1 = 0 0 0 (338)
[E132 (, , )] = c s 0 c c (331) c c s 0
c s c c s s

0 0 0 0
c c s s s E132
1 1 = 0 c s c (339)
0
[E132 (, , )] = 0 s c c c (332)
c 0 s c c
0 c s

0 0 0 c
c/2 c/2 c/2 s/2 s/2 s/2 E132
c/2 s/2 s/2 + c/2 c/2 s/2 = 0 0 c s (340)
q132 (, , ) = (333) 0 0 s s
c/2 c/2 s/2 + s/2 c/2 s/2
c/2 c/2 s/2 s/2 c/2 s/2

R132
=


0 0 0
s s c + c s s c s s s + c c (334)
c s c s s c c c s s s c

26
8.5 Euler Angle Sequence (2,1,2) z

z
R212 (, , ) = R2 ()R1 ()R2 () = z

c c s c s s s c s s c c
s s c s c (341)
s c + c c s s c s s + c c c
z
y, y

1 0
L{R212 (, , )} = 0 1 (342)
+ 1
y, y
x
212 (R) atan2 (r12 , r32 )
u212 (R) = 212 (R) = acos (r22 ) (343)
212 (R) atan2 (r21 , r23 )

atan2 2q1 q2 + 2q0 q3 ,

2q 2 q3 + 2q0 q1 x, x
2 2 2
u212 (Rq (q)) = acos q2 q3 + q0 q1 2
(344)
atan2 2q1 q2 2q0 q3 ,

2q2 q3 + 2q0 q1 x


s s c 0 Figure 9: Euler Angle Sequence (2,1,2)
E212 (, , ) = c 0 1 (345)
s c s 0
s s s s c s s c
R212
0 1 0 = c s s c c (353)
c s s c c c s c
L{E212 (, , )} = 1 0 1 (346)
0
R212
=
0 c s s

0
E212 (, , ) = 1 0 c (347) c s s c c 0 c c + s c s
0 s s c s c 0 s s (354)
s s + c c c 0 s c c c s
0 1 0
0
L{E212 (, , )} = 1 0 1 (348) c s 0 0
E212
0 = s 0 0 (355)
c c 0 0

s 0 c
1 1
[E212 (, , )] = s c 0 s s (349) s c s 0
s E212
c s s c c = 0 0 0 (356)
s s c 0

s c s c c
1 1
0
[E212 (, , )] = s c 0 s s (350) 0 0 s s c
s s 0 c E212
= 0 0 0 (357)
0 c s s

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 (, , ) = 0 0 s c
c/2 c/2 s/2 + c/2 c/2 s/2 (351)
0
E212
= 0 0 s (358)
c/2 s/2 s/2 + s/2 c/2 s/2 0 0 c c
R212
=


s c c c s s c s s c c c
0 0 0 (352)
c c s c s s s c s s c c

27
8.6 Euler Angle Sequence (2,1,3) z, z
z

R213 (, , ) = R2 ()R1 ()R3 () = z




c c s s s c s + s s c c s
c s c c s (359)
y, y
s c + c s s s s c s c c c

1

L{R213 (, , )} = 1 (360)
1
y
x
213 (R) atan2 (r13 , r33 ) y
u213 (R) = 213 (R) = asin (r23 ) (361) x, x
213 (R) atan2 (r21 , r22 )

atan2 2q1 q3 + 2q0 q2 ,
2 2 2 2 x
q3 q2 q1 + q0

u213 (Rq (q)) = asin 2q
2 q3 + 2q0 q1 (362)
atan2 2q1 q2 + 2q0 q3 , Figure 10: Euler Angle Sequence (2,1,3)
2 2 2 2

q2 q3 + q0 q1

s c s s c c s s
c s c 0 R213
= s s c s c (371)
E213 (, , ) = c c s 0 (363) c c s c c c c s
s 0 1
R213
1 0 =

L{E213 (, , )} = 1 0 (364)
0 1 c s s s c c c s s s 0
c c c s 0 (372)
s s + c s c s c + c s s 0
0 c c s
0
E213 (, , ) = 1 0 s (365)
0 s c c s s 0 0
E213
= c s 0 0 (373)
c 0 0
0 1
0
L{E213 (, , )} = 1 0 (366)
0 1 c c s 0
E213
= c s c 0 (374)

s c 0 0 0 0
1 1
[E213 (, , )] = c c c s 0 (367)
c s s c s c 0 0 s c c
E213
= 0 0 0 (375)

s s c c s 0 c s c
1 1
0
[E213 (, , )] = c c 0 s c (368)
c s 0 c 0 0 s s
0
E213
= 0 0 c (376)
0 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
q213 (, , ) =
c/2 s/2 s/2 + c/2 c/2 s/2 (369)
c/2 c/2 s/2 + s/2 c/2 s/2

R213
=


s c c s s s s + c s c c c
0 0 0 (370)
c c s s s c s + s s c s c

28
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 (377)
s c s s c c s s s s + c c y
y, y


1
L{R231 (, , )} = 1 (378) x
1

x, x
231 (R) atan2 (r31 , r11 )
u231 (R) = 231 (R) = asin (r21 ) (379) y
231 (R) atan2 (r23 , r22 ) x


atan2 2q1 q3 + 2q0 q2 , Figure 11: Euler Angle Sequence (2,3,1)
2 2 2 2
q1 + q0 q3 q2

u231 (Rq (q)) = asin 2q1 q2 2q0 q3 (380)
c s c c c c c s
atan2 2q2 q3 + 2q0 q1 , R231
2 2 2 2
= c s c s s (389)
q2 q3 + q0 q1 s s s c c s c s

s 0 1
R231
E231 (, , ) = c c s 0 (381) =
c s c 0

0 c s s + s c c s c + s s
0
0 1 c s c c (390)
L{E231 (, , )} = 1 0 (382) 0 s s s c c s s c c s
1 0
c 0 0
E231
0 s c c = s c 0 0 (391)

0
E231 (, , ) = 1 0 s (383) s s 0 0
0 c s c
0 0 0
E231
0 1 = c s c 0 (392)

0
L{E231 (, , )} = 1 0 (384) c c s 0
0 1
0 0 c s c
E231
0 c s = 0 0 0 (393)
1 1
[E231 (, , )] = 0 c s c c (385) 0 s c c
c c s c s s
0 0 0 c s
E231
c s
1
c s s = 0 0 c (394)
0
[E231 (, , )]
1
= s c 0 c c (386) 0 0 s s
c c 0 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
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 s s c + c s s s s c c
0 0 0 (388)
c c c s c + s s c s s s c

29
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 (395)
s c c + c s s s s c s + c c z

1 y, y
L{R232 (, , )} = 1 0 (396)
+ 0 1
x
232 (R) atan2 (r32 , r12 ) y, y
u232 (R) = 232 (R) = acos (r22 ) (397)
232 (R) atan2 (r23 , r21 )

atan2 2q2 q3 2q0 q1 ,

2q 1 q2 + 2q0 q3 x x
2 2 2
u232 (Rq (q)) = acos q2 q3 + q0 q1 2
(398)
atan2 2q2 q3 + 2q0 q1 ,

2q1 q2 + 2q0 q3 x

s c s 0 Figure 12: Euler Angle Sequence (2,3,2)
E232 (, , ) = c 0 1 (399)
s s c 0
c s c c c c s s
R232
0 = c c s c s (407)
s s c s c s s s
L{E232 (, , )} = 1 0 1 (400)
0 1 0
R232
=
0 s c s

0
E232 (, , ) = 1 0 c (401) c c s s c 0 c c c + s s
0 c s s s s 0 s c (408)
s c s + c c 0 s c c c s
0

0
L{E232 (, , )} = 1 0 1 (402) c c 0 0
0 1 0 E232
= s 0 0 (409)
c s 0 0

c 0 s
1 1
[E232 (, , )] = s s 0 s c (403) s s c 0
s c c s s c E232
= 0 0 0 (410)
s c s 0

c c s s c
1 1
0
[E232 (, , )] = s s 0 c s (404) 0 c s s
s c 0 s
0
E232
= 0 0 0 (411)
0 s c 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 (405) 0
E232
0 0 c c
= 0 0 s (412)
c/2 c/2 s/2 + s/2 s/2 s/2 0 0 s c
R232
=


s c c c s s s s c s c c
0 0 0 (406)
c c c s s c s c c s s c

30
8.9 Euler Angle Sequence (3,1,2) z

R312 (, , ) = R3 ()R1 ()R2 () = z


z, z
c c + s s s s c c s + s s c y
s c + c s s c c s s + c s c (413)
c s s c c
y
1
L{R312 (, , )} = 1 (414)
1

y, y
312 (R) atan2 (r12 , r22 )
u312 (R) = 312 (R) = asin (r32 ) (415) x
312 (R) atan2 (r31 , r33 )

atan2 2q1 q2 + 2q0 q3 ,
2 2 2 2
q2 q3 + q0 q1
x


u312 (Rq (q)) = asin 2q2 q3 2q0 q1 (416)

atan2 2q1 q3 + 2q0 q2 , x, x
2 2 2 2

q3 q2 q1 + q0
Figure 13: Euler Angle Sequence (3,1,2)
c s c 0
E312 (, , ) = s 0 1 (417)
s c s s s s c c
c c s 0 R312
= c c s c s c c c (425)
s s c s c
1 0
L{E312 (, , )} = 0 1 (418)
R312
1 0 =


0 c s c c s + s s c 0 c c s s s
0
E312 (, , ) = 0 s c c (419) s s + c s c 0 s c c s s (426)
1 0 s c c 0 c s

0 1 s s 0 0
E312
0
L{E312 (, , )} = 0 1 (420) = c 0 0 (427)
s c 0 0
1 0

s 0 c c c s 0
1 E312
[E312 (, , )]
1
= c c 0 c s (421) = 0 0 0 (428)
c c s c 0
s s c c s

s s c s c 0 s c c
1 1 0
E312
0
[E312 (, , )] = c c s c 0 (422) = 0 c s c (429)
c s c 0 0 0 0

c/2 c/2 c/2 + s/2 s/2 s/2 0 0 0 s s
c/2 c/2 s/2 + s/2 c/2 s/2 E312
= 0 0 c s (430)
q312 (, , ) =
c/2 c/2 s/2 s/2 c/2 s/2 (423) 0 0 c
c/2 s/2 s/2 + c/2 c/2 s/2

R312
=


s c + c s s c c s s + c s c
c c s s s s c c s s s c (424)
0 0 0

31
8.10 Euler Angle Sequence (3,1,3) z, z
z, z

R313 (, , ) = R3 ()R1 ()R3 () =


y
c c s c s c s + s c c s s
s c c c s s s + c c c c s (431) y

s s s c c

1 + 0
L{R313 (, , )} = 1 (432)
0 1 y


313 (R) atan2 (r13 , r23 ) x
x
u313 (R) = 313 (R) = acos (r33 ) (433) y
313 (R) atan2 (r31 , r32 ) x, x

atan2 2q1 q3 2q0 q2 , Figure 14: Euler Angle Sequence (3,1,3)

2q 2 q3 + 2q0 q1
2 2 2
u313 (Rq (q)) = acos q3 q2 q1 + q0 2
(434)
atan2 2q1 q3 + 2q0 q2 , s s s s s c s c
R313
2q2 q3 + 2q0 q1 = c s s c s c c c (443)
s c c c s

s s c 0
E313 (, , ) = s c s 0 (435) R313
=
c 0 1

c s s c c c c s c s 0
0 1 0 s s c c c s c c c s 0 (444)
L{E313 (, , )} = 0 (436) s c s s 0
1 0 1

s c 0 0
0 c s s E313
= c c 0 0 (445)
0
E313 (, , ) = 0 s c s (437) s 0 0
1 0 c

s c s 0
0 1 0 E313
= s s c 0 (446)
0
L{E313 (, , )} = 0 (438) 0 0 0
1 0 1

0 0 s c s
s c 0 E313
1 1 = 0 c s s (447)
[E313 (, , )] = s c s s 0 (439) 0 0 0
s s c c c s

0 0 0 s c
s c c c s E313
1 1 = 0 0 c c (448)
0
[E313 (, , )] = c s s s 0 (440) 0 0 s
s s c 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 (441)
c/2 c/2 s/2 + c/2 c/2 s/2

R313
=


s c c c s s s + c c c c s
c c + s c s c s s c c s s (442)
0 0 0

32
8.11 Euler Angle Sequence (3,2,1) z
z

R321 (, , ) = R3 ()R2 ()R1 () = y


z, z
c c s c + c s s s s c s c
s c c c s s s c s + s s c
(449)
s s c c c y, y


1
L{R321 (, , )} = 1 (450)

1

321 (R) atan2 (r21 , r11 )
y
u321 (R) = 321 (R) = asin (r31 ) (451)
x, x
321 (R) atan2 (r32 , r33 )

x
atan2 2q1 q2 + 2q0 q3 ,
2 2 2 2
q1 + q0 q3 q2

u321 (Rq (q)) = asin 2q
1 q3 + 2q0 q2 (452) x
atan2 2q2 q3 + 2q0 q1 ,
2 2 2 2

q3 q2 q1 + q0
Figure 15: Euler Angle Sequence (3,2,1)

s 0 1

E321 (, , ) = s c c 0 (453) c s c c s c c c
c c s 0 R321
= s s s c s s c c (461)
c s s s c

0 1
L{E321 (, , )} = 1 0 (454) R321
1 0 =


0 s s + c s c s c + c s s
0 s c c 0 c s s s c c c s s s (462)
0
E321 (, , ) = 0 c s c (455)
0 c c c s
1 0 s

c 0 0
0 1 E321
= s s 0 0 (463)
0
L{E321 (, , )} = 0 1 (456) s c 0 0
1 0

0 s c 0 0 0
E321
[E321 (, , )]
1
=
1
0 c c c s (457) = c c s 0 (464)
c c s c 0
c s s s c

c s s s c 0 0 c s c
1 E321
0
[E321 (, , )]
1
= s c c c 0 (458) = 0 s c c (465)
c 0 0 0
c s 0

c/2 c/2 c/2 s/2 s/2 s/2 0 0 0 c s
E321
c/2 c/2 s/2 + s/2 c/2 s/2 = 0 0 s s (466)
q321 (, , ) = (459) 0 0 c
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
=


s c c c s s s c s + s s c
c c s c c s s s s + c s c (460)
0 0 0

33
8.12 Euler Angle Sequence (3,2,3) z, z

z, z
R323 (, , ) = R3 ()R2 ()R3 () =

c c c s s c c s + s c c s
s c c c s s c s + c c s s (467)
s c s s c
y
1 +
L{R323 (, , )} = 1 0 (468)
0 1 x y, y

323 (R) atan2 (r23 , r13 ) x

y
u323 (R) = 323 (R) = acos (r33 ) (469)
323 (R) atan2 (r32 , r31 )


atan2 2q2 q3 + 2q0 q1 , x x

2q 1 q3 + 2q0 q2
2 2 2
u323 (Rq (q)) = acos q3 q2 q1 + q0 2
(470)
atan2 2q2 q3 2q0 q1 , Figure 16: Euler Angle Sequence (3,2,3)

2q1 q3 + 2q0 q2

c s c c s s c c
s c s 0 R323
= s s c s s s s c (479)
E323 (, , ) = s s c 0 (471) c c c s s
c 0 1
R323
0 =

L{E323 (, , )} = 0 1 0 (472)
c c s s c c c c s s 0
1 0 1 s c s c c s c c c s 0 (480)
s s s c 0
0 s c s
0
E323 (, , ) = 0 c s s (473)
1 0 c c c 0 0
E323
= c s 0 0 (481)
s 0 0
0
0
L{E323 (, , )} = 0 1 0 (474)
1 0 1 s s c 0
E323
= s c s 0 (482)
0 0 0
c s 0
1 1
[E323 (, , )] = s s s c 0 (475)
s c c s c s 0 0 c s s
E323
= 0 s c s (483)
0 0 0
c c s c s
1 1
0
[E323 (, , )] = s s c s 0 (476)
s c s 0 0 0 0 c c
E323
= 0 0 s c (484)
0 0 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
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 s c s + c c s s
c c c + s s c c s s c c s (478)
0 0 0

34
References
[1] Donald T. Greenwood. Principles of Dynamics, Second
Edition. Prentice Hall, Upper Saddle River, NJ, 1988.
[2] Arend L. Schwab. Quaternions, fi-
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