Representing Attitude: Euler Angles, Unit Quaternions, and Rotation Vectors James Diebel Stanford University Stanford, California 94301 9010 Email: diebel@stanford.edu 0 October 006 Abstract We present the three main mathematical constructs used to represent the attitude of a rigid body in threedimensional space. These are (1) the rotation matrix, () a triple of Euler angles, and (3) the unit quaternion. To these we add a fourth, the rotation vector, which has many of the benefits of both Euler angles and quaternions, but neither the singularities of the former, nor the quadratic constraint of the latter. There are several other subsidiary representations, such as Cayley-Klein parameters and the axis-angle representation, whose relations to the three main representations are also described. Our exposition is catered to those who seek a thorough and unified reference on the whole subject; detailed derivations of some results are not presented. Keywords Euler angles, quaternion, Euler-Rodrigues parameters, Cayley-Klein parameters, rotation matrix, direction cosine matrix, transformation matrix, Cardan angles, Tait-Bryan angles, nautical angles, rotation vector, orientation, attitude, roll, pitch, yaw, bank, heading, spin, nutation, precession, Slerp 1
Contents 1 Introduction 4 1.1 Overview of Contents.............................................. 4 1. Sources...................................................... 4 1.3 Coordinate Systems............................................... 4 Rotation Matrix 4.1 Coordinate Transformations........................................... 5. Transformation Matrix.............................................. 5.3 Pose of a Rigid Body............................................... 5.4 Coordinate Rotations.............................................. 5.5 Direction Cosine Matrix............................................. 5.6 Basis Vectors................................................... 6.7 Rotation Matrix Multiplication......................................... 6 3 Kinematics 6 3.1 Notation...................................................... 6 3. 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. 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. 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,,3).......................................... 11 5.6.1 Usage................................................... 11 5.6. Euler Angles Rotation Matrix.................................... 11 5.6.3 Euler Angles Rotation Matrix.................................... 1 5.6.4 Euler Angles Euler Angle Rates Matrices.............................. 1 5.6.5 Euler Angles Unit Quaternion.................................... 1 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,,3).................................. 13 5.9. Sequence (1,,3) Sequence (3,1,3).................................. 13 6 Quaternions 14 6.1 General Quaternions............................................... 14 6. 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
6.11 Unit Quaternion Cayley-Klein Parameters................................. 17 6.1 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. 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................................ 0 7.7 Rotation Vector Rotation Matrix...................................... 0 7.8 Rotation Vector Multiplication......................................... 1 7.9 Rotation Vector Rates Quaternion Rates.................................. 1 7.10 Rotation Vector Rates Angular Velocity.................................. 1 7.11 Rotation Vector Rates Angular Velocity.................................. 1 7.1 Integration of Angular Velocity......................................... 1 8 A Catalog of Euler Angle Parameterizations 8.1 Euler Angle Sequence (1,,1).......................................... 3 8. Euler Angle Sequence (1,,3).......................................... 4 8.3 Euler Angle Sequence (1,3,1).......................................... 5 8.4 Euler Angle Sequence (1,3,).......................................... 6 8.5 Euler Angle Sequence (,1,).......................................... 7 8.6 Euler Angle Sequence (,1,3).......................................... 8 8.7 Euler Angle Sequence (,3,1).......................................... 9 8.8 Euler Angle Sequence (,3,).......................................... 30 8.9 Euler Angle Sequence (3,1,).......................................... 31 8.10 Euler Angle Sequence (3,1,3).......................................... 3 8.11 Euler Angle Sequence (3,,1).......................................... 33 8.1 Euler Angle Sequence (3,,3).......................................... 34 3
1 Introduction This document is intended as a unified reference on the subject of parameterizing the attitude of an object in threedimensional space. It has been written to fill 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 unable to find any single reference that covers all the topics 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 particular convention without explicitly stating their choice, and without commenting on the alternatives. Furthermore, the existing on-line literature has a particularly large gap in the area of the various possible choices of Euler angle 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 () that they are less accurate than unit quaternions when used to integrate incremental changes in attitude over time. These deficiencies in the Euler angle representation have led researchers to use unit quaternions as a parametrization of the attitude of a rigid body. The relevant functions of unit quaternions have no singularities and the representation 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 () 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 optimization algorithms cannot encode such constraints. As an alternative to Euler angles and the unit quaternion, we offer 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 references 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 define the coordinate systems that are used throughout this report. Sec. introduces the idea of rotation matrices and describes several of their key properties. Rigid-body kinematics are introduced in Sec. 3. Euler angles are discussed in all their diversity in Sec. 5, including detailed discussions of the three most commonly-used conventions. Quaternions, especially unit quaternions and the axis-angle representation, are discussed in Sec. 6. The rotation vector is developed in Sec. 7 as a three-dimensional parametrization of a quaternion. Finally, a catalog of the twelve different Euler angle parameterizations is presented in Sec. 8. Throughout this report, conversions between the various representations, and explanatory notes regarding usage and naming conventions are included where appropriate. 1. Sources The mathematical results in this report have been derived from basic definitions and first principles. Several sources have been used to confirm our results and to provide information 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 [], especially the latter. On Kinematics, we cite [1]. 1.3 Coordinate Systems We consider the relationships between data expressed in two different coordinate systems: The world coordinate system is fixed in inertial space. The origin of this coordinate system is denotedx w. The body-fixed coordinate system is rigidly attached to the object whose attitude we would like to describe. The origin of this coordinate system is denoted x b. Points and vectors expressed in the body-fixed coordinates 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-fixed 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-fixed coordinates, and x b is the origin of the body-fixed coordinates expressed in the world coordinates. Some of the mathematics described in this document only apply when the world coordinate system is rotationally fixed. For many purposes, however, it is perfectly acceptable to consider a slowly-rotating coordinate system, such as one attached to Earth, to be a valid world coordinate system, despite its non-zero angular velocity. Rotation Matrix A rotation matrix is a matrix whose multiplication with a vector rotates the vector while preserving its length. The special orthogonal group of all 3 3 rotation matrices is denoted by SO(3). Thus, if R SO(3), then 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. Improper rotations are also known as rotoinversions, and consist of a rotation followed by an inversion operation. We restrict our analysis to proper rotations, as improper rotations are not rigid-body transformations. We reference the elements of a rotation matrix as follows: R [ ] r 1 r r 3 () r 11 r 1 r 13 r 1 r r 3. (3) r 31 r 3 r 33 There are two possible conventions for defining the rotation 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-fixed coordinates to 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 trivial as performing the transpose of a matrix, it is necessary to be sure that two different sources are using the same convention before using results from both sources together. Indeed, one of the motivations of this report is to provide a single coherent reference that covers the entire subject..1 Coordinate Transformations We define 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-fixed 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-fixed coordinates, then the following relations hold: z R z (4) z R T z. (5) These expression apply to vectors, relative quantities lacking a position in space. To transform a point from one coordinate system to the other we must subtract the offset to the origin of the target coordinate system before applying 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-fixed coordinates, then we may write x R (x x b ) R x + x w (6) x R T (x x w) R T x + x b. (7) Substituting x 0 into Eq. 6 and x 0 into Eq. 7 yields x w R x b (8) x b R T x w. (9). Transformation Matrix It is quite common in the computer graphics community to write Eqs. 6 and 7 as matrix-vector products: [ ] [ ] [ ] x R x w x 1 0 T (10) 1 1 [ ] [ ] R Rxb x 0 T (11) 1 1 [ x 1 ] [ ] [ ] R T x b x 0 T 1 1 [ ] [ R T R T x w x 0 T 1 1 (1) ]. (13) The substantial popularity of this convention is probably due to its adoption by the manufacturers of 3D-accelerated graphics hardware..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 parameterizations of attitude. The position is most naturally encoded by x b, the position of the origin of the body-fixed coordinates 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-fixed coordinates. The two are related to one another through the attitude of the body, according to Eqs. 8 and 9..4 Coordinate Rotations A coordinate rotation is a rotation about a single coordinate axis. Enumerating the x-, y-, and z-axes with 1,, and 3, the coordinate rotations, R i : R SO(3), for i {1,, 3}, are R 1 (α) 1 0 0 0 cos (α) sin (α) (14) 0 sin (α) cos (α) cos (α) 0 sin (α) R (α) 0 1 0 (15) sin (α) 0 cos (α) cos (α) sin (α) 0 R 3 (α) sin (α) cos (α) 0. (16) 0 0 1 A sample rotation of this form is illustrated in Fig. 1, which shows a rotation about the z-axis by an angle α..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-fixed axes and the world axes. Denoting the world axes by (x, y, z) 5
y α y 1 y [x 1 y 1 0] T R 3 (α) [x 1 y 1 0] T x.7 Rotation Matrix Multiplication The multiplication of two rotation matrices yields another rotation matrix whose application to a point effects the same rotation as the sequential application of the two original rotation matrices. For example, let z R a z (19) z R b/a z R b/a R a z R b z, (0) y 1 where x 1 α R b R b/a R a. (1) z, z x 1 x Note that the rotations are applied in the reverse order. That is, here we apply R a first, followed by R b/a. Figure 1: A sample coordinate rotation about the z-axis by an angle α. and the body-fixed axes by (x, y, z ), let x,y be, for example, 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 π α, y,x π + α, z,z 0, and z,{x,y} {x,y },z π. Expanding Eq. 17, R cos( x,x) cos( x,y) 0 cos( y,x) cos( y,y) 0 0 0 1 cos(α) cos( π α) 0 cos( π + α) 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..4..6 Basis Vectors The rotation matrix may also be thought of as the matrix of basis vectors that define the world and body-fixed coordinate systems. The rows of the rotation matrix are the basis vectors of the body-fixed coordinates expressed in world coordinates, and the columns are the basis vectors of the world coordinates expressed in the body-fixed coordinates. 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 define the relevant terms here. All of these quantities may be expressed in either the world coordinates or the body-fixed coordinates, whichever is more convenient. Body-fixed quantities are noted with a prime symbol. Conversions of vectors between the two coordinate systems are carried out according to Eqs. 4 and 5, and conversions of points are performed with Eqs. 6 and 7. All the quantities defined here are vector quantities, except x p and x b, which are points. x b, ẋ b, and ẍ b are the position, velocity, and acceleration of b. x p, ẋ p, and ẍ p are the position, velocity, and acceleration of p. x p/b, ẋ p/b, and ẍ p/b are the position, velocity, and acceleration of p relative to b (i.e., as seen by an observer rigidly attached to b). ω and ω are the angular velocity and angular acceleration of b. R is the rotation matrix of b, whose application is illustrated in Eqs. 4-7. Given these definitions, we consider two main cases. The first deals with a point rigidly attached to the body, and the second deals with a particle moving with respect to it. 6
3. Motion of a Fixed Point on a Rigid Body Let p be rigidly attached to the body, b, such that ẋ p/b ẍ p/b 0. The velocity of the point, p, is then ẋ p ẋ b + ω x p/b ẋ b + C(ω) x p/b, () where the skew-symmetric cross product matrix function C : R 3 R 3 3 is defined by C(ω) 0 ω 3 ω ω 3 0 ω 1. (3) ω ω 1 0 Alternatively, we may express the velocity in more convenient terms by using a combination of world and body-fixed terms: ( ) ẋ p ẋ b + R T ω x p/b The acceleration of p is ẋ b + R T C(ω ) x p/b. (4) ẍ p ẍ b + ω x p/b + ω ( ω x p/b ) ẍ b + [ C( ω) + C(ω) ] x p/b, (5) or, using a combination of world and body-fixed terms: [ ( )] ẍ p ẍ b + R T ω x p/b + ω ω x p/b where C(ω) ẍ b + R T [ C( ω ) + C(ω ) ] x p/b, (6) ω 3 ω ω ω 1 ω 3 ω 1 ω ω 1 ω 3 ω 1 ω 3 ω ω 3 ω 1 ω 3 ω ω ω 1. (7) 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 ẋ p ẋ b + ẋ p/b + ω x p/b and the acceleration is ẋ b + R T ( ẋ p/b + ω x p/b ẋ b + R T ( ẋ p/b + C(ω ) x p/b angular {}}{{}}{ ẍ p ẍ b + ω x p/b + ω ( ) ω x p/b ) centripetal ), (8) + ẍ p/b + ω ẋ p/b. (9) }{{} Coriolis Again, we may reconfigure this to yield a more useful final expression: [ [C( ẍ p ẍ b + R T ω ) + C(ω ) ] x p/b ] + ẍ p/b + C(ω )ẋ p/b. (30) From these results, it can be seen that Eqs. 8-30 are strict generalizations of Eqs. and 4 and Eqs. 5 and 6. 4 Finite Difference Approximations At several points in this paper the angular velocity of a rigid body is related to the time derivative of the the attitude parameters. In many applications, it is necessary to approximate these time derivatives using finite difference approximations. In this section, the most common and useful finite difference approximations are presented and discussed. We will discuss a general time-varying vector quantity, z (t) R n. Finite difference approximations are denoted with the operator n S,h, where n is the order of the derivative, S is the stencil over which the finite difference approximation is computed, and h is the size of the time increment between samples. Finite difference operators are linear combinations of function evaluations in the neighborhood of the evaluation point. A general finite difference approximation is written n S,hz (t 0 ) 1 h n a k z (t 0 + kh) k S 1 c h n b k z (t 0 + kh), (31) k S where {a k Q k S} is the set finite difference coefficients for which c Z and {b k Z k S} are a convenient rational decomposition. The actual derivative of the function is z (n) (t 0 ) n S,hz (t 0 ) + d h m z (n+m) (η), (3) 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 example, halving the step size produces a fourfold improvement in accuracy for second-order accurate methods but only a twofold improvement for first-order accurate methods. Tables 1 and show the finite difference coefficients 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 first 7
Table 1: Finite difference coefficients over a symmetric seven-point stencil. k m c -3 - -1 0 1 3 d First Derivative (b k ) 1 1-1 1 1/ 1 1-1 1-1/ 1-4 3 1/3-1 0 1-1/6-3 4-1 1/3 3 6-9 -18 11 1/4 3 6 1-6 3-1/1 3 6 - -3 6-1 1/1 3 6-11 18-9 -1/4 4 1-1 6-18 10 3-1/0 4 1 1-8 0 8-1 1/30 4 1-3 -10 18-6 1-1/0 5 60-15 -60 0 30-3 1/60 5 60 3-30 -0 60-15 -1/60 6 60-1 9-45 0 45-9 1-1/140 Second Derivative (b k ) 1 1 1-1 1 1 1 1-1 -1 1-1 4-5 11/1 1 1-1 -1/1 1-5 4-1 11/1 3 1-1 4 6-0 11-1/1 3 1 11-0 6 4-1 1/1 4 1-1 16-30 16-1 1/90 6 180-7 70-490 70-7 -1/560 Third Derivative (b k ) 1 1-1 3-3 1 3/ 1 1-1 3-3 1 1/ 1 1-1 3-3 1-1/ 1 1-1 3-3 1-3/ 1-6 1-10 3 1/4-1 0-1 -1/4-3 10-1 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/10 Fourth Derivative (b k ) 1 1 1-4 6-4 1 1 1 1 1-4 6-4 1-1 1 1-4 6-4 1-1/6 4 6-1 1-39 56-39 1-1 7/40 Fifth Derivative (b k ) 1 1-1 5-10 10-5 1 1/ 1 1-1 5-10 10-5 1-1/ -1 4-5 0 5-4 1-1/3 Sixth Derivative (b k ) 1 1-6 15-0 15-6 1-1/4 Table : Finite difference coefficients over a one-sided seven-point stencil. k m c 0 1 3 4 5 6 d First Derivative (b k ) 1 1-1 1-1/ -3 4-1 1/3 3 6-11 18-9 -1/4 4 1-5 48-36 16-3 1/5 5 60-137 300-300 00-75 1-1/6 6 60-147 360-450 400-5 7-10 1/7 Second Derivative (b k ) 1-5 4-1 11/1 3 1 35-104 114-56 11-5/6 4 1 45-154 14-156 61-10 137/180 Third Derivative (b k ) 1 1-1 3-3 1-3/ -5 18-4 14-3 7/4 3 4-17 71-118 98-41 7-15/8 4 8-49 3-461 496-307 104-15 9/15 Fourth Derivative (b k ) 1 1 1-4 6-4 1-1 3-14 6-4 11-17/6 3 6 35-186 411-484 31-114 17-7/ Fifth Derivative (b k ) 1 1-1 5-10 10-5 1-5/ -7 40-95 10-85 3-5 5/6 Sixth Derivative (b k ) 1 1 1-6 15-0 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, defined 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) Relative Error [%] 16 14 1 10 8 6 4 (α sin(α))/sin(α) (1 cos(α))/cos(α) 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-fixed coordinates, then the following relations hold: z R ijk (u) z (35) z R ijk (u) T z. (36) 5. Euler Angle Rates and Angular Velocity The time-derivative of the Euler angle vector is the vector of Euler angle rates. The relationship between the Euler angle rates and the angular velocity of the body is encoded in the Euler angle rates matrix. Multiplying this matrix by the vector of Euler angle rates gives the angular velocity in the global coordinates. Letting ê i be the 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 ê i, R k () T ê j, ê k ], (37) and the related conjugate Euler angle rates matrix function, E : R 3 R 3x3, whose multiplication with the vector of Euler angle rates yields the body-fixed angular velocity is Hence, E ijk(,, ) : [ê i, R i ()ê j, R i ()R j ()ê k ]. (38) ω E ijk (u) u (39) ω E ijk(u) u. (40) Noting also that the angular velocity in the body-fixed coordinates may be related to the angular velocity in the global coordinates by ω R ijk (u) ω (41) ω R ijk (u) T ω, (4) 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 0 5 10 15 0 5 30 Angle, α [degrees] Figure : 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 consider 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 substitutions are valid for small values of α. Fig. shows the relative error in these approximations as a function of the input angle. A relative error of 1% is reached in the approximation to the sine at an angle of 14 ; for the cosine, the same error is reached at an angle of 8.. Typically, these approximations are considered valid for angles less than 10. We denote the linearization operation by L. For example, 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 rotation sequence. Linearizing about an attitude other than zero is most easily accomplished by considering small perturbations about a fixed 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 u0 (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 specified what sequences of coordinate 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,,3) (3,1,3) (3,,3) π π x y x y x y z z z x z z y x y z y x mensional rotations. In fact, of the 7 possible sequences of three integers in {1,, 3}, there are only 1 that satisfy the constraint that no two consecutive numbers in a valid sequence may be equal. These are (i, j, k) { (1,, 1), (1,, 3), (1, 3, 1), (1, 3, ), (, 1, ), (, 1, 3), (, 3, 1), (, 3, ), (3, 1, ), (3, 1, 3), (3,, 1), (3,, 3) }. (48) The three in bold, (1,, 3), (3, 1, 3), and (3,, 3), are the most common choices. These three conventions are contrasted in Table 3 and the first two are discussed presently. 5.5 Euler Angle Sequence (3,1,3) 5.5.1 Usage The most common sequence associated with the name Euler angles is (3, 1, 3), named for Leonhard Euler, an 18thcentury Swiss mathematician and physicist. To disambiguate 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 spinning top. In this case, the body-fixed z-axis is aligned with the spin-axis of the top, and the body-fixed x- and 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. 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 s c s + s c c s c c c s s s + c c c s s c s s s s c 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 c c s s s + c c c c s c c + s c s c s s c c s s R 313 R 313 s s s s s c s c c s s c s c c c c s c c s c s s c c c c s c s 0 s s c c c s c c c s 0 s c s s 0 5.5.3 Euler Angles Rotation Matrix (51) (5). (53) 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) atan (r 13, r 3 ) acos (r 33 ) atan (r 31, r 3 ) atan ( q 1 q 3 q 0 q,) q q 3 + q 0 q 1 u 313 (R q (q)) acos ( q 3 q q 1 + q ) 0 atan ( q 1 q 3 + q 0 q, ) q q 3 + q 0 q 1 (54) (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 s c 0 s c s 0 (56) c 0 1 L{E 313 (,, )} [E 313 (,, )] 1 1 s 0 0 1 0 1 0 1 s c 0 s c s s 0 s c c c s (57) (58) 10
x z, z x, x z, z x Figure 3: Euler Angle Sequence (3,1,3) E 313(,, ) L{E 313(,, )} [E 313(,, )] 1 1 s 0 c s s 0 s c s 1 0 c 0 1 0 0 1 0 1 y y y y (59) s c c c s c s s s 0 s c 0 (60). (61) The derivatives of the Euler angle rates matrices with respect to the Euler angles are E 313 c s 0 0 c c 0 0 (6) s 0 0 E 313 s c s 0 s s c 0 (63) E 313 0 s c s 0 c s s (64) E 313 0 0 s c 0 0 c c 0 0 s 5.5.5 Euler Angles Unit Quaternion. (65) The function that maps Euler angles to their corresponding unit quaternion is c / c / c / s / c / s / q 313 (,, ) c / c / s / + s / s / s / c / s / s / s / c / s /. (66) c / c / s / + c / c / s / 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 coefficient is 1/ sin(). It is a notable characteristic of this parametrization, and all parameterizations of the form (i, j, i), that there exists a singularity at the home position, [,, ] [0, 0, 0]. This and other singularities are discussed further in Sec. 5.8. 5.6 Euler Angle Sequence (1,,3) 5.6.1 Usage The angles associated with the sequence (1,, 3) are sometimes called Cardan angles, for Gerolamo Cardano, an Italian Renaissance mathematician; Tait-Bryan angles, for Peter Guthrie Tait, a 19th-century Scottish mathematical physicist; or nautical angles. They are commonly used in aerospace engineering and computer graphics. Despite the lack of consensus on the issue, these angles are also commonly referred to simply as Euler angles in the aeronautics field, in which,, and are known respectively as roll, pitch, and yaw, or, equivalently, bank, attitude, and heading. Respecting the common and technical usage of these terms, these angles describe a vehicle whose forward direction is along the positive body-fixed x-axis, with the body-fixed y-axis to starboard, and the body-fixed z-axis downward. In such a configuration, the home position, [,, ] [0, 0, 0], is flat and level, pointing forward along the world x-axis. The non-intuitive downward-pointing z-axis is chosen in order to make a positive change in correspond to pitching upward. A less common standard using the same sequence is to have the y-axis point to port and the z-axis point upward. In this case, a positive change in corresponds to pitching downward. 5.6. Euler Angles Rotation Matrix The function that maps a vector of Euler angles to its rotation matrix, and that same function linearized, are R 13 (,, ) R 1 ()R ()R 3 () c c c s s s s c c s s s s + c c c s (67) c s c + s s c s s s c c c L{R 13 (,, )} 1 1 1. (68) 11
z, z 5.6.4 Euler Angles Euler Angle Rates Matrices z z The Euler angle rates matrices as a function of the Euler angles, their linearized equivalents, and their inverses, are E 13 (,, ) c c s 0 c s c 0 (74) s 0 1 x x y y y, y L{E 13 (,, )} [E 13 (,, )] 1 1 c 1 0 1 0 0 1 c s 0 c s c c 0 c s s s c (75) (76) x, x Figure 4: Euler Angle Sequence (1,,3) The derivatives of the rotation matrix with respect to the Euler angles are R 13 c s c + s s c s s s c c c s s c + c s s s s c c s c R 13 c s s s c s c c s c s s s c c c c c s c s R 13 c s c c 0 s s s c c s s c c s 0 c s s + s c c s c + s s 0 5.6.3 Euler Angles Rotation Matrix (69) (70). (71) 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 13 (R) 13(R) 13 (R) atan (r 3, r 33 ) asin (r 13 ) (7) 13 (R) atan (r 1, r 11 ) atan ( q q 3 + q 0 q 1, q 3 q q 1 + q ) 0 u 13 (R q (q)) asin ( ) q 1 q 3 q 0 q atan ( q 1 q + q 0 q 3, q 1 + q 0 q 3 q ) (73) E 13(,, ) L{E 13(,, )} [E 13(,, )] 1 1 c 1 0 s 0 c c s 0 s c c 1 0 0 1 0 1 c s s c s 0 c c s c 0 s c (77) (78). (79) The derivatives of the Euler angle rates matrices with respect to the Euler angles are E 13 c s 0 0 s s 0 0 (80) c 0 0 E 13 E 13 E 13 c s c 0 c c s 0 0 s c c 0 c s c 0 0 c 0 0 s s 0 0 c s 5.6.5 Euler Angles Unit Quaternion (81) (8). (83) The function that maps Euler angles to their corresponding unit quaternion is c / c / c / + s / s / s / q 13 (,, ) c / s / s / + c / c / s / c / c / s / + s / c / s /. (84) c / c / s / s / c / s / 1
5.6.6 Singularities This parametrization has singularities at pitch values of π + nπ, for n Z. It is thus only suitable for describing 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 functions. The derivatives of most of these will be familiar to the reader, but three of them warrant mention. The fourquadrant inverse tangent, atan : R R [ π, π], and its derivatives are atan(y, x) atan(y/x) if x > 0 atan(y/x) π if x < 0 y < 0 atan(y/x) + π if x < 0 y > 0 atan(y, x) x atan(y, x) y (85) y x + y (86) x x + y. (87) The derivatives of the inverse sine and inverse cosine are dasin(x) 1 dx 1 x dacos(x) dx 5.8 Singularities (88) 1 1 x. (89) The singularities found in the various Euler angle representations are said to arise from gimbal lock. Two examples of this phenomenon are presented in Sec s. 5.5.6 and 5.6.6. Gimbal lock may be understood in several different ways. Intuitively, it arises from the indistinguishability of changes in the first and third Euler angles when the second Euler angle is at some critical value. Take, for example, the (1,, 3) sequence. When the pitch angle is 90 degrees, the vehicle is pointing straight up, and roll and yaw are indistinguishable. In the case of the (3, 1, 3) sequence, when the nutation angle is zero, changes in the spin angle are the same as changes in the precession angle. The phenomenon may also be seen in the mathematics, where it manifests itself as singularities. Again, consider the (1,, 3) sequence. In this case, when cos() 0, then r 3 r 33 r 1 r 11 0, and the expressions for 13 (R) and 13 (R) in Eq. 73 are undefined. A similar consequence may be observed in the case of the (3, 1, 3) sequence when sin() 0. This effect is even more obvious in Eqs. 56 and 74, where the singularity may be seen directly in the leading coefficient. A common strategy for dealing with this problem is to change representations whenever an object nears a singularity. Even more popular is the use of unit quaternions to represent an object s 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 complications when attempting to optimize over the quaternion parameters. This is due to the fact that a unity norm constraint is quadratic in form and thus impossible to include 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 between (3, 1, 3) sequence and the (1,, 3) sequence are provided, along with Jacobians required for filtering applications. 5.9.1 Sequence (3,1,3) Sequence (1,,3) A set of (3, 1, 3) Euler angles may be written as a function of a set of (1,, 3) Euler angles according to u 13 313 (,, ) u 313 (R 13 (,, )) atan ( s, s c ) acos (c c ) (90) atan (c s c + s s, c s s + s c ) The Jacobian of this function with respect to the (1,, 3) Euler angles is where u 13 313 u [ u 13 313 u 13 313 ] u 13 313 1 c s c s 0 as c ac s 0 (91) a s s c c a a : 1 c c (9) is a repeating term that has been factored for notational and computational ease. 5.9. Sequence (1,,3) Sequence (3,1,3) A set of (1,, 3) Euler angles may be written as a function of a set of (3, 1, 3) Euler angles according to u 313 13 (,, ) u 13 (R 313 (,, )) atan (c s, c ) asin (s s ) (93) atan (c s + s c c, c c s c s ) 13
The Jacobian of this function with respect to the (3, 1, 3) Euler angles is where u 313 13 u [ u 313 13 1 c c u 313 13 ] u 313 13 1 a s 1 s c a c ( ) c + s 0 1 b c s 1 b s c 0 ( ) s + c 1 c c s s 1 a : c + c s (94) b : 1 s s (95) c : s c + c (96) are repeating terms that have been factored for notational and computational ease. 6 Quaternions Quaternions were first devised by William Rowan Hamilton, a 19th-century Irish mathematician. There is a substantial body of quaternion mathematics that are beyond the scope of this report. Consequently, we focus on the essential definitions 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, q 3 ] T q0, (97) q 1:3 along with a set of additional definitions and operations that may be applied to it. The adjoint, norm, and inverse of the quaternion, q, are [ ] q q 0 (98) q 1:3 q q0 + q 1 + q + q 3 (99) q 1 q q. (100) 6. Quaternion Multiplication Quaternion multiplication is not commutative. Quaternion multiplication between quaternions q and p is defined by q p q m (q, p) (101) [ ] q 0 p 0 q T 1:3p 1:3 (10) q 0 p 1:3 + p 0 q 1:3 q 1:3 p 1:3 [ ] [ ] q0 q T 1:3 p0 (103) q 1:3 q 0 I 3 C(q 1:3 ) p 1:3 [ ] [ ] p0 p T 1:3 q0, (104) p 1:3 p 0 I 3 + C(p 1:3 ) q 1:3 where the skew-symmetric cross product matrix function C : R 3 R 3 3 is defined by C(x) 0 x 3 x x 3 0 x 1. (105) x x 1 0 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 first 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 4 4 is defined by [ ] q0 q Q(q) T 1:3 (108) q 1:3 q 0 I 3 + C(q 1:3 ) q 0 q 1 q q 3 q 1 q 0 q 3 q q q 3 q 0 q, (109) 1 q 3 q q 1 q 0 and the the closely related conjugate quaternion matrix function, Q : H R 4 4 is defined by [ ] q0 q Q(q) T 1:3 (110) q 1:3 q 0 I 3 C(q 1:3 ) q 0 q 1 q q 3 q 1 q 0 q 3 q q q 3 q 0 q. (111) 1 q 3 q q 1 q 0 Substituting Eq. 98 into Eqs. 108 and 110 yields Q( q) Q(q) T (11) Q( q) Q(q) T. (113) The derivatives of the quaternion multiplication function are q m (q, p) q (114) q m (q, p) Q(q). p (115) The derivatives of the quaternion matrix functions with respect to the parameters of the quaternion are Q q 0 Q q 1 0 1 0 0 0 0 1 0 1 0 0 1 0 1 1 0 1 0 0, Q q 1, Q q 3 0 1 0 0 1 1 0 0 1 0 1 0 0 1 0 0 1 0 0 1, (116). (117) 14
Q q 0 Q q 1 0 1 0 0 0 0 1 0 1 0 0 1 0 1 1 0 1 0 0, Q q 1, Q q 3 0 1 0 0 1 1 0 0 1 0 1 0 0 1 0 0 1 0 0 1, (118). (119) 6.4 Unit Quaternion Rotation Matrix Unit quaternions are quaternions with unity norm. Throughout this section, we assume that q 1. (10) 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 bodyfixed coordinates, then the following relations hold: [ ] [ ] 0 0 z q q z 1 (11) [ ] 0 q q (1) z [ ] Q(q) T 0 Q(q) (13) z [ ] [ ] 1 0 T 0, (14) 0 R q (q) z where R q (q) (15) q 0 + q1 q q3 q 1 q + q 0 q 3 q 1 q 3 q 0 q q 1 q q 0 q 3 q0 q1 + q q3 q q 3 + q 0 q 1. q 1 q 3 + q 0 q q q 3 q 0 q 1 q0 q1 q + q3 That is, z R q (q)z (16) z R q (q) T z. (17) 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 6.5 Unit Quaternion Rotation Matrix The reverse mapping, from a rotation matrix to a quaternion, is slightly more complicated. Inspection of Eq. 15 yields the following relations: 4q 0 1 + r q11 (q) + r q (q) + r q33 (q) (131) 4q 1 1 + r q11 (q) r q (q) r q33 (q) (13) 4q 1 r q11 (q) + r q (q) r q33 (q) (133) 4q 3 1 r q11 (q) r q (q) + r q33 (q) (134) 4q q 3 r q3 (q) + r q3 (q) (135) 4q 1 q 3 r q31 (q) + r q13 (q) (136) 4q 1 q r q1 (q) + r q1 (q) (137) 4q 0 q 1 r q3 (q) r q3 (q) (138) 4q 0 q r q31 (q) r q13 (q) (139) 4q 0 q 3 r q1 (q) r q1 (q). (140) From these we arrive at four different inverse mappings. These are q i R : SO(3) H for i {0, 1,, 3}, defined by (1 + r 11 + r + r 33 ) 1 q 0 R(R) 1 (r 3 r 3 )/(1 + r 11 + r + r 33 ) 1 (r 31 r 13 )/(1 + r 11 + r + r 33 ) 1 (141) (r 1 r 1 )/(1 + r 11 + r + r 33 ) 1 (r 3 r 3 )/(1 + r 11 r r 33 ) 1 q 1 R(R) 1 (1 + r 11 r r 33 ) 1 (r 1 + r 1 )/(1 + r 11 r r 33 ) 1 (14) (r 31 + r 13 )/(1 + r 11 r r 33 ) 1 (r 31 r 13 )/(1 r 11 + r r 33 ) 1 q R(R) 1 (r 1 + r 1 )/(1 r 11 + r r 33 ) 1 (1 r 11 + r r 33 ) 1 (143) (r 3 + r 3 )/(1 r 11 + r r 33 ) 1 (r 1 r 1 )/(1 r 11 r + r 33 ) 1 q 3 R(R) 1 (r 31 + r 13 )/(1 r 11 r + r 33 ) 1 (r 3 + r 3 )/(1 r 11 r + r 33 ) 1. (144) (1 r 11 r + r 33 ) 1 R q (q p) R q (q)r q (p). (18) The derivatives of the rotation matrix function with respect to the quaternion parameters are R q q 0 q 3 q q 3 q 0 q 1, R q q 1 q q 3 q q 1 q 0, (19) q 0 q q 1 q q 1 0 q 3 q 0 q 1 R q q q 1 q 0 q 1 q q 3, R q q 3 q 0 q 1 q 0 q 3 q. (130) q q 0 q 3 q q 3 q 1 q q 3 Depending on the values of R, some of these functions will produce complex results. To avoid such an event, we define the following composite function, which selects the best of these four, depending on the parameters of R. The function, q R : SO(3) H, is q R (R) : q 0 R(R) if r > r 33, r 11 > r, r 11 > r 33 q 1 R(R) if r < r 33, r 11 > r, r 11 > r 33 q R(R) if r > r 33, r 11 < r, r 11 < r 33 q 3 R(R) if r < r 33, r 11 < r, 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 quaternion and its temporal derivative to the angular velocity in world and body-fixed coordinates are ω q : H R 4 R 3 and ω q : H R 4 R 3, defined by [ [ More compactly: 0 ω q (q, q) 0 ω q(q, q) ] q q Q(q) T q (146) ] q q Q(q) T q. (147) ω q (q, q) : W (q) q (148) ω q(q, q) : W (q) q, (149) where the quaternion rates matrices, W : H R 3 4 and W : H R 3 4, are defined by W (q) : q 1 q 0 q 3 q q q 3 q 0 q 1 (150) q 3 q q 1 q 0 W (q) : q 1 q 0 q 3 q q q 3 q 0 q 1. (151) q 3 q q 1 q 0 The derivatives of the quaternion rates matrices with respect to the parameters of the quaternion are W 0 1 0 0 0 0 1 0, W 1 1, (15) q 0 1 q 1 0 0 1 0 W, W, (153) q q 3 1 1 0 1 0 0 W 0 1 0 0 0 0 1 0, W q 0 1 q 1 W q 1 1 0 1 0 0, W q 3 0 0 1 0 0 1 0 0 1 1 1 0 0 1 0, (154) 0 0 1 0 0 1 0 0, (155) 1 6.7 Quaternion Rates Angular Velocity The inverse mapping, from the angular velocity and the unit quaternion to the quaternion rates, is closely related. The functions q ω : H R 3 R 4 and q ω : H R 3 R 4 q ω (q, ω) 1 [ ] 0 q 1 [ ] 0 ω Q(q) (156) ω q ω (q, ω ) 1 [ ] 0 ω q 1 [ ] Q(q) 0 ω. (157) More compactly: q ω (q, ω) 1 W (q)t ω (158) q ω (q, ω ) 1 W (q) T ω. (159) 6.8 Quaternion Rates Angular Acceleration The angular acceleration, expressed in the global and bodyfixed coordinates may also be related to time derivatives of the quaternion parameters by [ ] [ ] q q q + (160) 0 ω 0 [ ] Q(q) T q q + (161) 0 [ 0 ω ] More compactly: [ ] q q q + 0 [ Q(q) T q q + 0 (16) ]. (163) ω q (q, q) : W (q) q (164) ω q(q, q) : W (q) q. (165) 6.9 Quaternion Rates Angular Acceleration The inverse mappings, from the angular acceleration rates to the second derivative of the quaternion, are q ω (q, ω) : 1 W (q)t ω (166) q ω (q, ω ) : 1 W (q) T ω. (167) 6.10 Unit Quaternion Cayley-Klein Parameters The Cayley-Klein parameters are closely related to the unit quaternion. Consequently we will give it only brief mention here. The Cayley-Klein parameters are α, β, γ, and δ C. These parameters are often arranged as a 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 H, is 1 ([ q ]) (α + δ) α β K i (β + γ) γ δ 1 (β γ). (17) (α δ) i The function that maps the Cayley-Klein parameters to their corresponding rotation matrix, R c : C SO(3), is ([ R α β K γ δ]) (173) 1 (α β γ +δ ) i ( α β +γ +δ ) (γδ αβ) i (α β +γ δ 1 ) (α +β +γ +δ ) i (αβ+γδ). (βδ αγ) i (αγ+βδ) (αδ+βγ) 6.11 Unit Quaternion Cayley-Klein Parameters The inverse mapping is K q : H C, defined by K q (q) [ ] [ ] αq (q) β q (q) q0 + iq 3 iq 1 + q. (174) γ q (q) δ q (q) iq 1 q q 0 iq 3 Other relationships involving Cayley-Klein parameters, such as those between the Cayley-Klein parameters and the Euler angles may be derived from Eq. 17 through composition with the appropriate functions in Sec. 6 or Sec. 8. 6.1 Unit Quaternion Axis-Angle Any finite rotation may be achieved by a single rotation about an appropriately chosen axis. It is therefore possible to parameterize the attitude of a rigid body with an angle α R and a unit vector n S, where S : {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 H, define by q a (α, n) : [ cos ( 1 α) n sin ( 1 α) ]. (175) Here, we emphasize that we are constrained to consider only vectors n that satisfy the quadratic norm constraint, n 1. Differentiating with respect to α and n yields [ q a α 1 sin ( 1 α) ] 1 n cos ( 1 α) (176) [ q a n 0 T I 3 sin ( 1 α) ] s α 0 0 0 s α 0 0 0 s α (177). (178) The corresponding quaternion matrices are given by the functions Q a : R S R 4 4 and Q a : R S R 4 4, where Q a (α, n) Q(q a (α, n)) (179) c α n 1 s α n s α n 3 s α n 1 s α c α n 3 s α n s α n s α n 3 s α c α n 1 s α n 3 s α n s α n 1 s α c α (180) Q a (α, n) Q(q a (α, n)) (181) c α n 1 s α n s α n 3 s α n 1 s α c α n 3 s α n s α n s α n 3 s α c α n 1 s α n 3 s α n s α n 1 s α c α. (18) The corresponding rotation matrix is given by the function R a : R S SO(3), define by R a (α, n) R q (q a (α, n)) (183) [ r a1 (α, n) r a (α, n) r a3 (α, n) ], (184) the columns of which read ( n1 n 3 n ) s α + c α r a1 (α, n) n 1 n s α n 3 c α s α n 1 n 3 s α + n c α s α n 1 n s α + n 3 c α s α ( r a (α, n) n n 3 n ) 1 s α + c α r a3 (α, n) n n 3 s α n 1 n 3 s α n 1 c α s α n c α n n 3 s α + n 1 c α ( n3 n n ) 1 s α s α s α + c α (185) (186). (187) This representation, while perhaps more intuitive than the quaternion, is functionally equivalent to it: both require four parameters and a single quadratic constraint. In order to overcome this problem, and produce a quaternion representation that requires only three parameters, we will continue this development in Sec. 7. Before moving on from the axis-angle representation, we present some derivatives of key results. Differentiating Eqs. 181-187 with respect to α and n yields ( 1 n1 + n + n ) 3 r a1 α r a α 1 s α n 1 n s α n 3 c α n 1 n 3 s α + n c α (188) n 1 n s α + n 3 c α 1 s ( α 1 + n1 n + n ) 3 (189) n n 3 s α n 1 c α n 1 n 3 s α n c α n n 3 s α + n 1 c α 1 s ( α 1 + n1 + n n ) (190) 3 n 1(1 c α ) n (1 c α ) n 3 (1 c α ) n (1 c α ) n 1 (1 c α ) s α (191) n 3 (1 c α ) s α n 1 (1 c α ) r a3 α R a n 1 17
R a n R a n 3 n (1 c α ) n 1 (1 c α ) s α n 1 (1 c α ) n (1 c α ) n 3 (1 c α ) (19) s α n 3 (1 c α ) n (1 c α ) n 3(1 c α ) s α n 1 (1 c α ) s α n 3 (1 c α ) n (1 c α ) (193) n 1 (1 c α ) n (1 c α ) n 3 (1 c α ) Q a α c α/ Q a α c α/ t α/ n 1 n n 3 n 1 t α/ n 3 n n n 3 t α/ n 1 n 3 n n 1 t α/ t α/ n 1 n n 3 n 1 t α/ n 3 n n n 3 t α/ n 1 n 3 n n 1 t α/ (194) (195) Q ( a α ) Q sin, and (196) n i q i Q ( a α ) Q sin, for i {1,, 3}. (197) n i q i Here, we have employed the shorthand t α/ : tan(α/) in addition to the familiar s α/ : sin(α/) and c α/ : cos(α/). 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 corresponding axis and angle of rotation, are α q : H R and n q : H S, defined by α q (q) : acos(q 0 ) (198) n q (q) : q 1:3 q 1:3 q 1:3 1 q 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 (, ê i ) q a (, ê j ) q a (, ê k ). (00) Differentiating with respect to the Euler angles yields q ijk (,, ) q a α q a (, ê j ) q a (, ê k ) (01),êi q ijk (,, ) q a (, ê i ) q a α q a (, ê k ) (0),êj q ijk (,, ) q a (, ê i ) q a (, ê j ) q a α. (03),êk 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 included as state variables in an optimization. In these cases, the difficult problem of how to impose the unity norm constraint arises. Various techniques are used to solve this problem, though none of them are completely satisfactory. For iterative optimization algorithms, such as the conjugate gradient algorithm, it is possible to simply re-normalize the quaternions after each iteration. When using a direct method, however, this strategy is usually insufficient. In such cases, terms of the form c (1 q ) 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 require a quadratic norm constraint in order to be valid rotations. This problem can be overcome by folding the unity norm constraint into the parametrization. There are several 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 object s attitude. 7.1 Rotation Vector Axis-Angle We define the rotation vector as a function of the axis and angle of a rotation, v a : R S R 3, by v a (α, n) : αn. (04) 7. Rotation Vector Axis-Angle Noting that n 1, we may invert this definition to yield the functions α v : R 3 R and n v : R 3 S, defined by Here we have used the shorthand, α v (v) : v v (05) n v (v) : v v v v. (06) v : v. (07) 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 unit quaternion, q v : R 3 H, by [ ( cos v ) ] q v (v) : q a (α v (v), n v (v)) v v sin ( ) v (08) [ 1 lim q v(v) lim 1 v 0 v 0 v ]. (09) The derivatives of q v with respect to the parameters of v are presented in this section. In order to provide compact expressions, we have factored them in terms of the following two quantities: a : c v v (10) b : s v 6c v v (11) We differentiate Eq. 08 to yield G(v) [ g 1 (v), g (v), g 3 (v) ] : q [ ] v v qv q v q v,, v 1 v v 3 s [ ] v v T + a [ ] 0 T v I 3 v 3 vv T s v v v 1 v v 3 0 0 0 0 0 0 + a v 3 (1) v 1 v 1 v v 1 v 3 v 1 v v v v (13) 3 v 1 v 3 v v 3 v 3 v 1 v s v v 1 v s v v 3 v s v v s v + v v 3 1 a v 1 v a v 1 v 3 a v 1 v a v s v + v a v v 3 a v 1 v 3 a v v 3 a v s v + v 3 a G s v v i v lim G(v) 1 v 0 4 + v ib 4v 5 G s v v 1 v + v 1b 4v 5 [ êt i v 1 v v 3 0 0 0 0 0 0 (14) (15) ] + a [ ] v i v T 0 3 3 4v 3 ( ) ê i v T + vê T i + v i I 3 [ ] 0 T vv T (16) G lim 1 [ ] êt i v 0 v i 4 0 3 3 (17) 1 0 0 v + a 1 v 1 v v 1 v 3 6v 1 v v 3 4v 3 v v 1 0 v 3 0 v 1 v1 v 1 v v 1 v 3 v 1 v v v v (18) 3 v 1 v 3 v v 3 v3 G s v v v + v b 4v 5 G s v v 3 v + v 3b 4v 5 0 1 0 v 1 v v + a v v 3 v v 1 0 4v 3 v 1 6v v 3 0 v 3 v v1 v 1 v v 1 v 3 v 1 v v v v (19) 3 v 1 v 3 v v 3 v3 0 0 1 v 1 v 3 v v 3 v + a 3 v 3 0 v 1 4v 3 0 v 3 v v 1 v 6v 3 v1 v 1 v v 1 v 3 v 1 v v v v. (0) 3 v 1 v 3 v v 3 v3 7.4 Rotation Vector Unit Quaternion The inverse mapping, v q : H R 3, which maps a unit quaternion to a rotation vector, is defined by H(q) : v q q v q (q) : α q (q)n q (q) (1) acos(q 0 ) q 1:3 q 1:3 () acos(q 0) q (1 q0 ) 1 1:3 (3) lim v q(q) q 1:3 (4) q 1:3 0 c : 1 1 q 0 (5) d : acos (q 0) 1 q0 cq 1 (dq 0 1) d 0 0 cq (dq 0 1) 0 d 0 cq 3 (dq 0 1) 0 0 d lim H(q) q 1:3 0 0 0 0 0 0 0 (6) (7). (8) 7.5 Rotation Vector Quaternion Matrices The quaternion matrices may be written as a function of the rotation vector by composition of Eqs. 108 and 110, 19
and Eq. 08: Q v (v) : Q(q v (v)) 1 v Q v (v) : Q(q v (v)) 1 v vc v v 1 s v v s v v 3 s v v 1 s v vc v v 3 s v v s v v s v v 3 s v vc v v 1 s v v 3 s v v s v v 1 s v vc v vc v lim v 0 Q v(v) 1 lim Q v (v) 1 v 0 v 1 s v v s v v 3 s v v 1 s v vc v v 3 s v v s v v s v v 3 s v vc v v 1 s v v 3 s v v s v v 1 s v vc v v 1 v v 3 v 1 v 3 v v v 3 v 1 v 3 v v 1 v 1 v v 3 v 1 v 3 v v v 3 v 1 v 3 v v 1 (9) (30) (31). (3) The derivatives of the quaternion matrices with respect to the rotation vector parameters are Q v v j Q v v j 3 i0 Q q i q vi v j 3 i0 Q q i g ij (v) Q (g j (v)) (33) Q v lim 1 Q v (34) v 0 v j q j 3 i0 Q q i q vi v j 3 i0 Q q i g ij (v) Q (g j (v)) (35) lim Q v 1 Q v. (36) v 0 v j q j 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. 08: W v (v) : W (q v (v)) 1 v v 1 s v vc v v 3 s v v s v v s v v 3 s v vc v v 1 s v v 3 s v v s v v 1 s v vc v (37) W v(v) : W (q v (v)) 1 v lim v 0 W v(v) 1 lim v 0 W v(v) 1 v 1 s v vc v v 3 s v v s v v s v v 3 s v vc v v 1 s v v 3 s v v s v v 1 s v vc v v 1 v 3 v v v 3 v 1 v 3 v v 1 v 1 v 3 v v v 3 v 1 v 3 v v 1 (38) (39). (40) The derivatives of the quaternion rates matrices with respect to the rotation vector parameters are W v v j W v v j 3 i0 W q i q vi v j 3 i0 W q i g ij (v) W (g j (v)) (41) 3 i0 W q i q vi v j 3 i0 W q i g ij (v) W (g j (v)). (4) 7.7 Rotation Vector Rotation Matrix The rotation matrix may be written as a function of the rotation vector by composition of Eqs. 15 and 08: R v (v) : R q (q v (v)) [ r v1 (v) r v (v) r v3 (v) ], (43) the columns of which read ( ) v r v1 (v) 1 1 v v3 s v + v c v ( v s v v1 v s v vv ) v 3c ( s v v1 v 3 s v + vv ) (44) v c ( r v (v) 1 s v v1 v s v + vv ) v ( ) 3c v v v3 v1 s v + v c v ( s v v v 3 s v vv ) (45) v 1c ( r v3 (v) 1 s v v1 v 3 s v vv ) v ( c s v v v v 3 s v + vv ) v ( 1c ). (46) v 3 v1 v s v + v c v For very small v, we have: lim R v(v) v 0 1 v 3 v v 3 1 v 1 v v 1 1. (47) The derivatives of the rotation matrix with respect to the parameters of the rotation vector are R v v j [ rv1 3 i0 v j R q q i r v v j qv(v) ] r v3 v j q vi v j. (48) 0
where R v lim v 0 v 1 r vi v j F i (q v (v)) g j (v) (49) F 1 (q) q 0 q 1 q q 3 q 3 q q 1 q 0 (50) q q 3 q 0 q 1 F (q) q 3 q q 1 q 0 q 0 q 1 q q 3 (51) q 1 q 0 q 3 q F 3 (q) q q 3 q 0 q 1 q 1 q 0 q 3 q (5) q 0 q 1 q q 3 R v lim C(ê i ) (53) v 0 v j 0 0 1 0 1 0 R v lim v 0 v 3, 1 0 0 0 1 0 R v lim v 0 v 0 0 1 1 0 0,. (54) 7.8 Rotation Vector Multiplication The multiplication of two rotation vectors u and v R 3 is defined in terms of the product of quaternions: v u v m (v, u) v q (q m (q v (v), q v (u))). (55) 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) H(q m (q v (v), q v (u)) v Q (q v (u)) G(v) (56) v m (v,u) H(q m (q v (v), q v (u)) Q (q v (v)) G(u). (57) u Here, H(q), Q(q), and G(v) are given in Eqs. 7, 110, and 1. 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, defined by q v (q, v) q v v Here, G(v) is given in Eq. 1. v t G(v) v. (58) 7.10 Rotation Vector Rates Angular Velocity The time derivative of the rotation vector is the vector of rotation vector rates. The rotation vector rates, v, are related to the angular velocity. The functions that map a rotation vector and its temporal derivative to the angular velocity in world and body-fixed coordinates are ω v : R 3 R 3 R 3 and ω v : R 3 R 3 R 3, defined by ω v (v, v) : W v (v) q v (v) W v (v)g(v) v V (v) v (59) ω v(v, v) : W v(v) q v (v) W v(v)g(v) v V (v) T v, (60) where the rotation vector rates matrix, V : R 3 R 3 3, is defined by V (v) : W v (v)g(v), (61) where W v (v) and G(v) are defined in Eqs. 37 and 1. As it also holds that ω R v (v)ω, we have that R v (v) V (v) T V (v) 1 (6) R v (v) T V (v)v (v) T. (63) 7.11 Rotation Vector Rates Angular Velocity The functions that map the angular velocity in the bodyfixed and world coordinates to the rotation vector rates, v ω : R 3 R 3 R 3 and v ω : R 3 R 3 R 3, are defined by v ω (v, ω) 1 V (v) 1 ω (64) v ω (v, ω ) 1 V (v) T ω. (65) 7.1 Integration of Angular Velocity Quaternions are very well suited to tracking the attitude of an object by integrating the body-fixed angular velocity over time. Consider an object with a body-fixed angular velocity of ω (t). Let us consider the change in attitude from time t 0 to time t 1. We define the rotation vector over this interval to be v ω (t 0, t 1 ) : t1 t 0 ω (t) dt. (66) If the body-fixed angular velocity is provided as discrete samples, as, for example, from a set of rate gyros, the integration will have to be carried out numerically. The simplest such numerical integration is to compute the product of the time interval and the average of all the samples taken during that time interval. 1
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. (67) This equation may be easily generalized to read q i+1 q v (v ω (t i, t i+1 )) q i, (68) giving us a simple update rule for tracking the attitude of an object over time, given some measure of the body-fixed angular velocity. This method is much more accurate than integrating the Euler angle rates. 8 A Catalog of Euler Angle Parameterizations In this section we present an exhaustive catalog of the twelve different Euler angle parameterizations, including conversions to and from rotation matrices and quaternions, the relationship between the Euler angle rates and the angular velocity, and various derivatives of the fundamental results with respect to the Euler angles.
8.1 Euler Angle Sequence (1,,1) z z R 11 (,, ) R 1 ()R ()R 1 () c s s s c s s c c s c s c s + s c c c s s c c c s s s + c c c L{R 11 (,, )} 1 0 0 1 + 1 (69) (70) u 11 (R) 11(R) 11 (R) atan (r 1, r 31 ) acos (r 11 ) (71) 11 (R) atan (r 1, r 13 ) atan ( q 1 q q 0 q 3 ), q 1 q 3 + q 0 q u 11 (R q (q)) acos ( q 1 + q 0 q 3 q ) atan ( q 1 q + q 0 q 3, ) q 1 q 3 + q 0 q E 11 (,, ) L{E 11 (,, )} E 11(,, ) L{E 11(,, )} [E 11 (,, )] 1 1 s [E 11(,, )] 1 1 s q 11 (,, ) c 0 1 s s c 0 s c s 0 0 1 0 1 0 1 0 1 0 c 0 c s s 0 s c s 1 0 1 0 1 0 0 (7) (73) (74) (75) 0 s c 0 s c s s s c s c c s s c c c 0 c s s s 0 s c c / c / c / s / c / s / c / c / s / + c / c / s / c / c / s / + s / s / s / c / s / s / s / c / s / (76) (77) (78) (79) z x, x z x, x Figure 5: Euler Angle Sequence (1,,1) R 11 R 11 y s c s c c s c s s s s s c c c c s s c s c 0 s c s s 0 c s s c c c c s c s 0 s s c c c s c c c s E 11 E 11 E 11 E 11 s 0 0 c s 0 0 c c 0 0 s c s 0 s s c 0 0 s c s 0 c s s 0 0 s 0 0 s c 0 0 c c y, y y (81) (8) (83) (84) (85) (86) R 11 c s s c c c s s s + c c c s s c c + s c s c s s c c (80) 3
8. Euler Angle Sequence (1,,3) z, z R 13 (,, ) R 1 ()R ()R 3 () c c c s s s s c c s s s s + c c c s (87) c s c + s s c s s s c c c L{R 13 (,, )} 1 1 1 (88) u 13 (R) 13(R) 13 (R) atan (r 3, r 33 ) asin (r 13 ) (89) 13 (R) atan (r 1, r 11 ) atan ( q q 3 + q 0 q 1, q 3 q q 1 + q ) 0 u 13 (R q (q)) asin ( ) q 1 q 3 q 0 q atan ( q 1 q + q 0 q 3, q 1 + q 0 q 3 q ) (90) E 13 (,, ) L{E 13 (,, )} E 13(,, ) c c s 0 c s c 0 s 0 1 L{E 13(,, )} [E 13 (,, )] 1 1 c [E 13(,, )] 1 1 c q 13 (,, ) 1 0 1 0 0 1 1 0 s 0 c c s 0 s c c 1 0 0 1 0 1 (91) c s 0 c s c c 0 c s s s c c s s c s 0 c c s c 0 s c (9) (93) (94) (95) c / c / c / + s / s / s / c / s / s / + c / c / s / c / c / s / + s / c / s / c / c / s / s / c / s / (96) (97) x z x x, x z Figure 6: Euler Angle Sequence (1,,3) R 13 c s s s c s c c s c s s s c c c c c s c s R 13 c s c c 0 s s s c c s s c c s 0 c s s + s c c s c + s s 0 E 13 E 13 E 13 E 13 c s 0 0 s s 0 0 c 0 0 c s c 0 c c s 0 0 s c c 0 c s c 0 0 c 0 0 s s 0 0 c s y y y, y (99) (300) (301) (30) (303) (304) R 13 c s c + s s c s s s c c c s s c + c s s s s c c s c (98) 4
8.3 Euler Angle Sequence (1,3,1) z, z z y R 131 (,, ) R 1 ()R 3 ()R 1 () c c s s s c s c c c s s c c s + s c (305) s s s c c c s s c s + c c L{R 131 (,, )} 1 + 1 0 0 1 (306) u 131 (R) 131(R) 131 (R) atan (r 31, r 1 ) acos (r 11 ) (307) 131 (R) atan (r 13, r 1 ) atan ( q 1 q 3 + q 0 q, ) q 1 q + q 0 q 3 u 131 (R q (q)) acos ( q 1 + q 0 q 3 q ) atan ( q 1 q 3 q 0 q, ) q 1 q + q 0 q 3 E 131 (,, ) L{E 131 (,, )} E 131(,, ) c 0 1 c s s 0 s s c 0 L{E 131(,, )} [E 131 (,, )] 1 1 s [E 131(,, )] 1 1 s q 131 (,, ) 1 0 1 0 0 1 0 1 0 c 0 s c s 0 c s s 1 0 1 0 0 1 0 (308) (309) (310) (311) 0 c s 0 s s s c s c c c s s c c s c 0 s s c s 0 c s (31) c / c / c / s / c / s / c / c / s / + c / c / s / c / s / s / + s / c / s / c / c / s / + s / s / s / (313) (314) (315) z R 131 x, x x, x Figure 7: Euler Angle Sequence (1,3,1) R 131 s c c c s c c c s c c s s s c s s c s s s 0 s s s c 0 c c s s c c c c s s 0 s c s c c s c c c s E 131 E 131 E 131 E 131 s 0 0 c c 0 0 c s 0 0 s s c 0 s c s 0 0 c s s 0 s c s 0 0 s 0 0 c c 0 0 s c y y y (317) (318) (319) (30) (31) (3) R 131 s s s c c c s s c s + c c c s c c c + s s c c s s c (316) 5
8.4 Euler Angle Sequence (1,3,) z R 13 (,, ) R 1 ()R 3 ()R () c c s c s c s c + s s c c c s s + s c (33) s s c + c s s c s s s + c c L{R 13 (,, )} 1 1 1 (34) u 13 (R) 13(R) 13 (R) atan ( r 3, r ) asin (r 1 ) (35) 13 (R) atan ( r 13, r 11 ) atan ( q q 3 + q 0 q 1, q q 3 + q 0 q ) 1 u 13 (R q (q)) asin ( ) q 1 q + q 0 q 3 atan ( q 1 q 3 + q 0 q, q 1 + q 0 q 3 q ) (36) E 13 (,, ) L{E 13 (,, )} E 13(,, ) s 0 1 c c s 0 c s c 0 L{E 13(,, )} [E 13 (,, )] 1 1 c [E 13(,, )] 1 1 c q 13 (,, ) 0 1 1 0 1 0 1 0 s 0 s c c 0 c s c 1 0 0 1 0 1 (37) (38) (39) c 0 s c s 0 c c s c c s s c c s s s 0 s c c c 0 c s c / c / c / s / s / s / c / s / s / + c / c / s / c / c / s / + s / c / s / c / c / s / s / c / s / (330) (331) (33) (333) z x x R 13 z, z x, x y y, y Figure 8: Euler Angle Sequence (1,3,) c c c c s c c s s c c s s s c c s s s c s R 13 c s 0 c c c s s + s c 0 c s c s s s s s + c c 0 s s c c s E 13 E 13 E 13 E 13 s c 0 0 c 0 0 s s 0 0 c s c 0 c c s 0 0 c s c 0 s c c 0 0 c 0 0 c s 0 0 s s y (335) (336) (337) (338) (339) (340) R 13 s s c + c s s c s s s + c c c s c s s c c c s s s c (334) 6
8.5 Euler Angle Sequence (,1,) z R 1 (,, ) R ()R 1 ()R () c c s c s s s c s s c c s s c s c s c + c c s s c s s + c c c L{R 1 (,, )} 1 0 0 1 + 1 (341) (34) u 1 (R) 1(R) 1 (R) atan (r 1, r 3 ) acos (r ) (343) 1 (R) atan (r 1, r 3 ) atan ( q 1 q + q 0 q 3, ) q q 3 + q 0 q 1 u 1 (R q (q)) acos ( q q 3 + q 0 q ) 1 atan ( q 1 q q 0 q 3, ) q q 3 + q 0 q 1 E 1 (,, ) L{E 1 (,, )} E 1(,, ) s s c 0 c 0 1 s c s 0 L{E 1(,, )} [E 1 (,, )] 1 1 s [E 1(,, )] 1 1 s q 1 (,, ) 0 1 0 1 0 1 0 0 c s s 1 0 c 0 s s c 0 1 0 1 0 1 0 (344) (345) (346) (347) s 0 c s c 0 s s c s s c c s c s c c s c 0 s s s 0 c (348) c / c / c / s / c / s / c / c / s / + s / s / s / c / c / s / + c / c / s / c / s / s / + s / c / s / (349) (350) (351) z z R 1 x x, x z x y, y Figure 9: Euler Angle Sequence (,1,) R 1 c s s c c s s s s c s s c c s s c c c s c c s s c c 0 c c + s c s s c 0 s s s s + c c c 0 s c c c s E 1 E 1 E 1 E 1 c s 0 0 s 0 0 c c 0 0 s c s 0 s s c 0 0 s s c 0 c s s 0 0 s c 0 0 s 0 0 c c y, y (353) (354) (355) (356) (357) (358) R 1 s c c c s s c s s c c c c c s c s s s c s s c c (35) 7
8.6 Euler Angle Sequence (,1,3) z z, z R 13 (,, ) R ()R 1 ()R 3 () c c s s s c s + s s c c s c s c c s s c + c s s s s c s c c c L{R 13 (,, )} 1 1 1 (359) (360) u 13 (R) 13(R) 13 (R) atan ( r 13, r 33 ) asin (r 3 ) (361) 13 (R) atan ( r 1, r ) atan ( q 1 q 3 + q 0 q, q 3 q q 1 + q ) 0 u 13 (R q (q)) asin ( ) q q 3 + q 0 q 1 atan ( q 1 q + q 0 q 3, q q 3 + q 0 q ) (36) 1 E 13 (,, ) L{E 13 (,, )} E 13(,, ) c s c 0 c c s 0 s 0 1 L{E 13(,, )} [E 13 (,, )] 1 1 c [E 13(,, )] 1 1 c q 13 (,, ) 1 0 1 0 0 1 0 c c s 1 0 s 0 s c c 0 1 1 0 0 1 (363) (364) (365) s c 0 c c c s 0 s s c s c s s c c s c c 0 s c s 0 c c / c / c / s / s / s / c / c / s / s / c / s / c / s / s / + c / c / s / c / c / s / + s / c / s / (366) (367) (368) (369) x z R 13 x, x x Figure 10: Euler Angle Sequence (,1,3) R 13 s c s s c c s s s s c s c c c s c c c c s c s s s c c c s s s 0 c c c s 0 s s + c s c s c + c s s 0 E 13 E 13 E 13 E 13 c s 0 0 s s 0 0 c 0 0 c c s 0 c s c 0 0 s c c 0 c s c 0 0 s s 0 0 c 0 0 c s y y, y y (371) (37) (373) (374) (375) (376) R 13 s c c s s s s + c s c c c c c s s s c s + s s c s c (370) 8
8.7 Euler Angle Sequence (,3,1) z z, z z R 31 (,, ) R ()R 3 ()R 1 () c c c s c + s s c s s s c s c c c s s c s s c c s s s s + c c L{R 31 (,, )} 1 1 1 (377) (378) u 31 (R) 31(R) 31 (R) atan (r 31, r 11 ) asin (r 1 ) (379) 31 (R) atan (r 3, r ) atan ( q 1 q 3 + q 0 q, q 1 + q 0 q 3 q ) u 31 (R q (q)) asin ( ) q 1 q q 0 q 3 atan ( q q 3 + q 0 q 1, q q 3 + q 0 q ) (380) 1 E 31 (,, ) L{E 31 (,, )} E 31(,, ) s 0 1 c c s 0 c s c 0 L{E 31(,, )} [E 31 (,, )] 1 1 c [E 31(,, )] 1 1 c q 31 (,, ) 0 1 1 0 1 0 0 s c c 1 0 s 0 c s c 0 1 1 0 0 1 (381) 0 c s 0 c s c c c s c s s s c 0 c c c s c s s c 0 s (38) (383) (384) (385) c / c / c / + s / s / s / c / c / s / s / c / s / c / s / s / + c / c / s / c / c / s / + s / c / s / (386) (387) x, x x x y Figure 11: Euler Angle Sequence (,3,1) R 31 R 31 c s c c c c c s c s c s s s s s c c s c s 0 c s s + s c c s c + s s 0 c s c c 0 s s s c c s s c c s E 31 E 31 E 31 E 31 c 0 0 s c 0 0 s s 0 0 c s c 0 c c s 0 0 c s c 0 s c c 0 0 c s 0 0 c 0 0 s s y y, y (389) (390) (391) (39) (393) (394) R 31 s c s s c + c s s s s c c c c c s c + s s c s s s c (388) 9
8.8 Euler Angle Sequence (,3,) z R 3 (,, ) R ()R 3 ()R () c c c s s c s c c s s c s c c s s s c c + c s s s s c s + c c L{R 3 (,, )} 1 1 0 + 0 1 (395) (396) u 3 (R) 3(R) 3 (R) atan (r 3, r 1 ) acos (r ) (397) 3 (R) atan (r 3, r 1 ) atan ( q q 3 q 0 q 1 ), q 1 q + q 0 q 3 u 3 (R q (q)) acos ( q q 3 + q 0 q ) 1 atan ( q q 3 + q 0 q 1, ) q 1 q + q 0 q 3 E 3 (,, ) L{E 3 (,, )} E 3(,, ) s c s 0 c 0 1 s s c 0 L{E 3(,, )} [E 3 (,, )] 1 1 s [E 3(,, )] 1 1 s q 3 (,, ) 0 1 0 1 0 1 0 0 s c s 1 0 c 0 c s s 0 1 0 1 0 1 0 (398) (399) (400) (401) c 0 s s s 0 s c c c s s c c c s s c s s 0 c s c 0 s c / c / c / s / c / s / c / s / s / s / c / s / c / c / s / + c / c / s / c / c / s / + s / s / s / (40) (403) (404) (405) x x z, z z x x y, y Figure 1: Euler Angle Sequence (,3,) R 3 R 3 c s c c c c s s c c s c s s s c s c s s s c c s s c 0 c c c + s s s s 0 s c s c s + c c 0 s c c c s E 3 E 3 E 3 E 3 c c 0 0 s 0 0 c s 0 0 s s c 0 s c s 0 0 c s s 0 s c s 0 0 c c 0 0 s 0 0 s c y, y (407) (408) (409) (410) (411) (41) R 3 s c c c s s s s c s c c c c c s s c s c c s s c (406) 30
8.9 Euler Angle Sequence (3,1,) z R 31 (,, ) R 3 ()R 1 ()R () c + s s s s c c s + s c + c s s c c s s c s s + c s c c s s c c L{R 31 (,, )} 1 1 1 (413) (414) u 31 (R) 31(R) 31 (R) atan (r 1, r ) asin (r 3 ) (415) 31 (R) atan (r 31, r 33 ) atan ( q 1 q + q 0 q 3, q q 3 + q 0 q ) 1 u 31 (R q (q)) asin ( ) q q 3 q 0 q 1 atan ( q 1 q 3 + q 0 q, q 3 q q 1 + q ) (416) 0 E 31 (,, ) L{E 31 (,, )} E 31(,, ) c s c 0 s 0 1 c c s 0 L{E 31(,, )} [E 31 (,, )] 1 1 c [E 31(,, )] 1 1 c q 31 (,, ) 0 1 1 0 1 0 0 c s c 0 s c c 1 0 s 0 1 0 1 1 0 (417) s 0 c c c 0 c s s s c c s s s c s c c c s c 0 s c 0 (418) (419) (40) (41) c / c / c / + s / s / s / c / c / s / + s / c / s / c / c / s / s / c / s / c / s / s / + c / c / s / (4) (43) z, z x z x, x x Figure 13: Euler Angle Sequence (3,1,) R 31 R 31 s c s s s s c c c c s c s c c c s s c s c c s + s s c 0 c c s s s s s + c s c 0 s c c s s c c 0 c s E 31 E 31 E 31 E 31 s s 0 0 c 0 0 s c 0 0 c c s 0 c s c 0 0 s c c 0 c s c 0 0 s s 0 0 c s 0 0 c y y y, y (45) (46) (47) (48) (49) (430) R 31 s c + c s s c c s s + c s c c c s s s s c c s s s c (44) 31
8.10 Euler Angle Sequence (3,1,3) z, z z, z R 313 (,, ) R 3 ()R 1 ()R 3 () c s c s c s + s c c s c c c s s s + c c c s s c s s s s c c L{R 313 (,, )} 1 + 0 1 0 1 (431) (43) u 313 (R) 313(R) 313 (R) atan (r 13, r 3 ) acos (r 33 ) (433) 313 (R) atan (r 31, r 3 ) atan ( q 1 q 3 q 0 q ), q q 3 + q 0 q 1 u 313 (R q (q)) acos ( q 3 q q 1 + q ) 0 atan ( q 1 q 3 + q 0 q, ) q q 3 + q 0 q 1 E 313 (,, ) L{E 313 (,, )} E 313(,, ) s c s 0 s s c 0 c 0 1 L{E 313(,, )} [E 313 (,, )] 1 1 s [E 313(,, )] 1 1 s q 313 (,, ) 0 0 1 0 1 0 1 0 c s s 0 s c s 1 0 c 0 1 0 0 1 0 1 (434) (435) (436) (437) s c 0 s c s s 0 s c c c s s c c c s c s s s 0 s c 0 c / c / c / s / c / s / c / c / s / + s / s / s / c / s / s / s / c / s / c / c / s / + c / c / s / (438) (439) (440) (441) x x, x x Figure 14: Euler Angle Sequence (3,1,3) R 313 R 313 s s s s s c s c c s s c s c c c s c c c s c s s c c c c s c s 0 s s c c c s c c c s 0 s c s s 0 E 313 E 313 E 313 E 313 c c 0 0 s c 0 0 s 0 0 s c s 0 s s c 0 0 s c s 0 c s s 0 0 s c 0 0 c c 0 0 s y y y y (443) (444) (445) (446) (447) (448) R 313 s c c c s s s + c c c c s c c + s c s c s s c c s s (44) 3
8.11 Euler Angle Sequence (3,,1) z z R 31 (,, ) R 3 ()R ()R 1 () c s c + c s s s s c s c c c s s s s c c s + s s c s s c c c L{R 31 (,, )} 1 1 1 (449) (450) u 31 (R) 31(R) 31 (R) atan ( r 1, r 11 ) asin (r 31 ) (451) 31 (R) atan ( r 3, r 33 ) atan ( q 1 q + q 0 q 3, q 1 + q 0 q 3 q ) u 31 (R q (q)) asin ( ) q 1 q 3 + q 0 q atan ( q q 3 + q 0 q 1, q 3 q q 1 + q ) (45) 0 E 31 (,, ) L{E 31 (,, )} E 31(,, ) L{E 31(,, )} [E 31 (,, )] 1 1 c [E 31(,, )] 1 1 c q 31 (,, ) s 0 1 s c c 0 c c s 0 1 0 0 1 1 0 0 s c c 0 c s c 1 0 s 0 1 0 1 1 0 (453) (454) (455) 0 s c 0 c c c s c s s s c c s s s c s c c c 0 c s 0 c / c / c / s / s / s / c / c / s / + s / c / s / c / c / s / s / c / s / c / s / s / + c / c / s / (456) (457) (458) (459) z, z x, x R 31 x Figure 15: Euler Angle Sequence (3,,1) R 31 x c s c c s c c c s s s c s s c c c s s s c 0 s s + c s c s c + c s s 0 c s s s c c c s s s 0 c c c s E 31 E 31 E 31 E 31 c 0 0 s s 0 0 s c 0 0 c c s 0 c s c 0 0 c s c 0 s c c 0 0 c s 0 0 s s 0 0 c y y, y y (461) (46) (463) (464) (465) (466) R 31 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) 33
8.1 Euler Angle Sequence (3,,3) z, z R 33 (,, ) R 3 ()R ()R 3 () c c s s c c s + s c s c c c s s c s + c c c s s s s c s s c L{R 33 (,, )} 1 + 1 0 0 1 (467) (468) u 33 (R) 33(R) 33 (R) atan (r 3, r 13 ) acos (r 33 ) (469) 33 (R) atan (r 3, r 31 ) atan ( q q 3 + q 0 q 1, ) q 1 q 3 + q 0 q u 33 (R q (q)) acos ( q 3 q q 1 + q ) 0 atan ( q q 3 q 0 q 1, ) q 1 q 3 + q 0 q E 33 (,, ) L{E 33 (,, )} E 33(,, ) s c s 0 s s c 0 c 0 1 L{E 33(,, )} [E 33 (,, )] 1 1 s [E 33(,, )] 1 1 s q 33 (,, ) 0 0 1 0 1 0 1 0 s c s 0 c s s 1 0 c 0 0 1 0 1 0 1 (470) (471) (47) (473) c s 0 s s s c 0 c c s c s c c s c s s s c s 0 c s 0 (474) c / c / c / s / c / s / c / s / s / + s / c / s / c / c / s / + s / s / s / c / c / s / + c / c / s / (475) (476) (477) x R 33 x x z, z x Figure 16: Euler Angle Sequence (3,,3) R 33 c s c c s s c c s s c s s s s c c c c s s c c s s c c c c s s 0 s c s c c s c c c s 0 s s s c 0 E 33 E 33 E 33 E 33 c c 0 0 c s 0 0 s 0 0 y s s c 0 s c s 0 0 c s s 0 s c s 0 0 c c 0 0 s c 0 0 s y y, y (479) (480) (481) (48) (483) (484) R 33 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) 34
References [1] Donald T. Greenwood. Principles of Dynamics, Second Edition. Prentice Hall, Upper Saddle River, NJ, 1988. [] Arend L. Schwab. Quaternions, finite rotation and euler parameters. http://tam.cornell.edu/ als93/quaternion.pdf, 00. [3] Eric W. Weisstein. Cayley-klein parameters. From MathWorld A Wolfram Web Resource. http://mathworld.wolfram.com/cayley- KleinParameters.html. [4] Eric W. Weisstein. Euler angles. From MathWorld A Wolfram Web Resource. http://mathworld.wolfram.com/eulerangles.html. [5] Eric W. Weisstein. Euler parameters. From MathWorld A Wolfram Web Resource. http://mathworld.wolfram.com/eulerparameters.html. 35