Documente Academic
Documente Profesional
Documente Cultură
Coordinate System
Transformations
23
24 CHAPTER 3. COORDINATE SYSTEM TRANSFORMATIONS
3.2 Transformations
3.2.1 Definitions
Consider two reference frames, F1 and F2 , and a vector v whose components
are known in F1 , represented as {v}1 :
v x1
{v}1 = v y1
v z1
We wish to determine the representation of the same vector in F2 , or
{v}2 :
v x2
{v}2 = v y2
v z2
These are linear spaces, so the transformation of the vector from F1 to
F2 is simply a matrix multiplication which we will denote T2,1 , such that
{v}2 = T2,1 {v}1 . Transformations such as T2,1 are called similarity trans-
formations. The transformations involved in simple rotations of orthogonal
reference frames have many special properties that will be shown.
The order of subscripts of T2,1 is such that the left subscript goes with the
system of the vector on the left side of the equation and the right subscript
with the vector on the right. For the matrix multiplication to be conformal
T2,1 must be a 3x3 matrix:
t11 t12 t13
T2,1 = t21 t22 t23
t31 t32 t33
3.2. TRANSFORMATIONS 25
x1 x2
y1
z2 v
y2
z1
(The tij probably need more subscripting to distinguish them from those
in other transformation matrices, but this gets cumbersome.)
The whole point of the three approaches to be presented is to figure out
how to evaluate the numbers tij . It is important to note that for a fixed
orientation between two coordinate systems, the numbers tij are the same
quantities no matter how they are evaluated.
Derivation
Consider our two reference frames F1 and F2 , and the vector v, shown in
figure 3.1. We claim to know the representation of v in F1 . The vector v
is the vector sum of the three components vx1 i1 , vy1 j1 , and vz1 k1 so we may
replace the vector by those three components, shown in figure 3.2
Now, the projection of v onto x2 is the same as the vector sum of the
projections of each of its components vx1 i1 , vy1 j1 , and vz1 k1 onto x2 , and
similarly for y2 and z2 . Define the angle generated in going from x2 to x1 as
θx2 x1 . The projection of vx1 i1 onto x2 therefore has magnitude vx1 cos θx2 x1
and direction i2 , as shown if figure 3.3.
To the vector vx1 cos θx2 x1 i2 must be added the other two projections,
vy1 cos θx2 y1 i2 and vz1 cos θx2 z1 i2 . Similar projections onto y2 and z2 result in:
26 CHAPTER 3. COORDINATE SYSTEM TRANSFORMATIONS
x1 x2
y1
z2 v x 1i 1
v y 1j1 y2
z1
v z 1k1
x1 x2
v x 1i 1
v x 1 cos θ x 2x 1 i 2
θ x 2x 1
vx2 = vx1 cos θx2 x1 +vy1 cos θx2 y1 +vz1 cos θx2 z1
vy2 = vx1 cos θy2 x1 +vy1 cos θy2 y1 +vz1 cos θy2 z1
vz2 = vx1 cos θz2 x1 +vy1 cos θz2 y1 +vz1 cos θz2 z1
In vector-matrix notation, this may be written
v x2
cos θx2 x1 cos θx2 y1 cos θx2 z1 v x1
v y2 = cos θy2 x1 cos θy2 y1 cos θy2 z1 vy1
v z2 cos θz2 x1 cos θz2 y1 cos θz2 z1 v z1
Clearly this is {v}2 = T2,1 {v}1 , so we must have tij = cos θ(axis)2 (axis)1 in
which i or j is 1 if the corresponding (axis) is x, 2 if (axis) is y, and 3 if
(axis) is z.
cos θx2 x1 cos θx2 y1 cos θx2 z1
T2,1 = cos θy2 x1 cos θy2 y1 cos θy2 z1 (3.1)
cos θz2 x1 cos θz2 y1 cos θz2 z1
1
{v}1 = 0
0
Then {v}2 is just the first column of the direction cosine matrix:
cos θx2 x1
{v}2 = cos θy2 x1
cos θz2 x1
28 CHAPTER 3. COORDINATE SYSTEM TRANSFORMATIONS
The same obviously holds true for any column of the direction cosine
matrix.
If we need to go the other way, {v}1 = T1,2 {v}2 , it is clear that T1,2 =
−1
T2,1 , and we might be tempted to invert the direction cosine matrix. On the
other hand, had we begun by assuming {v}2 was known, and figuring out
how to get {v}1 = T1,2 {v}2 using similar arguments to the above, we would
have arrived at
v x1
cos θx1 x2 cos θx1 y2 cos θx1 z2 v x2
v y1 = cos θy1 x2 cos θy1 y2 cos θy1 z2 vy2
v z1 cos θz1 x2 cos θz1 y2 cos θz1 z2 v z2
Here we observe that cos θx1 x2 is the same as cos θx2 x1 , cos θx1 y2 is the
same as cos θy2 x1 , etc., since (even if we had defined positive rotations of
these angles) the cosine is an even function. So the same transformation is
v x1
cos θx2 x1 cos θy2 x1 cos θz2 x1 v x2
v y1 = cos θx2 y1 cos θy2 y1 cos θz2 y1 vy2
v z1 cos θx2 z1 cos θy2 z1 cos θz2 z1 v z2
Obviously the columns of T1,2 are the rows of T2,1 (and have unit length
as well). This leads us to another nice property of these transformation ma-
trices, that the inverse of the direction cosine matrix is equal to its transpose,
−1 T
T1,2 = T2,1 = T2,1
−1
Since T2,1 T2,1 T
= T2,1 T2,1 = I3 , the 3 × 3 identity matrix, it must be true
that the scalar (dot) product of any row of T2,1 with any other row must
−1 T
be zero. It is easy to show that T1,2 T1,2 = T1,2 T1,2 = I3 , so the scalar (dot)
product of any column of T2,1 with any other column must be zero since the
3.2. TRANSFORMATIONS 29
columns of T2,1 are the rows of T1,2 . When the rows (or columns) of the
direction cosine matrix are viewed as vectors, this means the rows (or the
columns) form orthogonal bases for 3-dimensional space.
T
Also,
T with
T2,1 T2,1 = I3 , if we take the determinant of each side and note
that T2,1 = |T2,1 |, we have
T
T2,1 T2,1
T
= |T2,1 | T2,1
= |T2,1 | |T2,1 |
= |T2,1 |2 = 1
The only conclusion we can reach at this point is that |T2,1 | = ±1. Be-
cause the identity matrix is a transformation matrix with determinant +1,
and since all other transformations may be reached through continuous rota-
tions from the identity transformation, it seems unreasonable to think that
the sign of the determinant would be different for some rotations and not
others. We will show in our discussion of Euler angles that the right answer
is indeed |T2,1 | = +1.
While we have 9 variables in T2,1 = {tij } , i, j = 1 . . . 3, there are 6
nonlinear constraining equations based on the orthogonality of the rows (or
columns) of the matrix. For the rows these are:
The result of these constraints is that there are only 3 independent vari-
ables. In principle all nine may be derived given any three that do not violate
a constraint.
x1
θz x′
y1
θz
y′
z1 = z′
x″
θy x′
θy y″ = y′
z″
z′
The final rotation (figure 3.6) is about x through angle θx and the final
alignment is parallel to the axes of F2 .
Consider first the rotation about z1 (Figure 3.7). In terms of the direc-
tion cosines previously defined, the angles between the axes are as follows:
between z1 and z it is zero; between either z and any x or y it is 90 deg;
between x1 and x or y1 and y it is θz ; between x1 and y it is 90 deg +θz ;
and between y1 and x it is 90 deg −θz . We therefore may write
32 CHAPTER 3. COORDINATE SYSTEM TRANSFORMATIONS
x″ = x 2
θx y″
z2 θx z″
y2
x1 x′
θz
v x ′i′
vx i1 v
v y 1j 1 y1
θz
v y ′j′
y′
v x
cos θx x1 cos θx y1 cos θx z1 1
v x
vy = cos θy x1 cos θy y1 cos θy z1 vy1
vz cos θz x1 cos θz y1 cos θz z1 v z1
cos θz cos (90 deg −θz ) cos 90 deg vx1
= cos (90 deg +θz ) cos θz cos 90 deg vy1
cos 90 deg cos 90 deg cos 0 v z1
cos θz sin θz 0 v x1
= − sin θz cos θz 0 vy1
0 0 1 v z1
cos θz sin θz 0
TF ,1 = − sin θz cos θz 0 (3.2)
0 0 1
cos θy 0 − sin θy
TF ,F = 0 1 0 (3.3)
sin θy 0 cos θy
From the rotation about x , finally, {v}2 = T2,F {v} with
1 0 0
T2,F = 0 cos θx sin θx (3.4)
0 − sin θx cos θx
1 0 0 cos θy 0 − sin θy cos θz sin θz 0
{v}2 = 0 cos θx sin θx 0 1 0 − sin θz cos θz 0 {v}1
0 − sin θx cos θx sin θy 0 cos θy 0 0 1
cos θy cos θz cos θy sin θz − sin θy
sin θx sin θy cos θz sin θx sin θy sin θz
sin θx cos θy
T2,1 =
− cos θ sin θ + cos θ cos θ
x z
x z
cos θx sin θy cos θz cos θx sin θy sin θz
cos θx cos θy
+ sin θx sin θz − sin θx cos θz
Since this is just a different way of representing the direction cosine ma-
trix, it must be true that cos θy cos θz = cos θx2 x1 , cos θy sin θz = cos θx2 y1 ,
etc. At this point we may observe that since T2,1 = T2,F TF ,F TF ,1 , we must
have
|T2,1 | = +1
It is very important to note that the Euler angles θx , θy , and θz have been
defined for a rotation from F1 to F2 using a 321 rotation sequence. Thus, a
321 rotation from F2 to F1 (T1,2 ) with suitably defined angles (say, φx , φy ,
and φz ) would have the same form as given for T2,1 , but the angles involved
would be physically different from those in T2,1 . So, for the rotation from F1
to F2 using a 321 rotation sequence:
3.2. TRANSFORMATIONS 35
cos φy cos φz cos φy sin φz − sin φy
sin φx sin φy cos φz sin φx sin φy sin φz
sin φx cos φy
T1,2 =
− cos φ sin φ + cos φ cos φ
x z
x z
cos φ x sin φy cos φz cos φx sin φ y sin φz
cos φx cos φy
+ sin φx sin φz − sin φx cos φz
−1 T
Alternatively we may note that T1,2 = T2,1 = T2,1 and may write the
matrix
sin θx sin θy cos θz cos θx sin θy cos θz
cos θy cos θz
− cos θx sin θz
+ sin θx sin θz
T1,2 =
cos θ sin θ sin θx sin θy sin θz cos θx sin θy sin θz
y z
+ cos θx cos θz − sin θx cos θz
− sin θy sin θx cos θy cos θx cos θy
The two matrices are the same, only the definitions of the angles are
different. Clearly the relationships among the two sets of angles are non-
trivial.
In short, the definitions of Euler angles are unique to the rotation sequence
used and the decision as to which frame one goes from and which one goes
to in that sequence. We will normally define our Euler angles going in only
one direction using a 321 rotation sequence, and rely on relationships like
−1 T
T1,2 = T2,1 = T2,1 to obtain the other.
.
q0 =cos (η/2)
.
q1 =ξ sin (η/2)
. (3.5)
q2 =ζ sin (η/2)
.
q3 =χ sin (η/2)
(q02 + q12 − q22 − q32 ) 2 (q1 q2 + q0 q3 ) 2 (q1 q3 − q0 q2 )
T2,1 = 2 (q1 q2 − q0 q3 ) (q02 − q12 + q22 − q32 ) 2 (q2 q3 + q0 q1 )
2 (q1 q3 + q0 q2 ) 2 (q2 q3 − q0 q1 ) (q02 − q12 − q22 + q32 )
(3.6)
Euler parameters have one great disadvantage relative to Euler angles:
Euler angles may in most cases be easily visualized. If one is given values of
θx , θy , and θz it is not hard to visualize the relative orientation of two coordi-
nate systems. A given set of Euler parameters, however, conveys almost no
information about how the systems are related. Thus even in applications
in which Euler parameters are preferred (such as in flight simulation), the
results are very often converted to Euler angles for ease of interpretation and
visualization.
The direct approach to convert a set of Euler parameters to the corre-
sponding set of Euler angles is to equate corresponding elements of the two
representations of the transformation matrix. We may combine the (2,3) and
(3,3) entries to obtain
−1 t23 −1 2 (q2 q3 + q0 q1 )
θx = tan = tan , −π ≤ θx < π
t33 q02 − q12 − q22 + q32
From the (1,3) entry we have
− sin θy = 2 (q1 q3 − q0 q2 )
3.2. TRANSFORMATIONS 37
−1 t12 −1 2 (q1 q2 + q0 q3 )
θz = tan = tan , 0 ≤ θz ≤ 2π
t11 q02 + q12 − q22 − q32
θx = tan−1 2(q2 q3 +q0 q1 )
q02 −q12 −q22 +q32
, −π ≤ θx < π
θy = − sin−1 (2q1 q3 − 2q0 q2 ), −π/2 ≤ θy ≤ π/2 (3.7)
θz = tan−1 2(q1 q2 +q0 q3 )
q02 +q12 −q22 −q32
, 0 ≤ θz ≤ 2π
Going the other way, from Euler angles to Euler parameters, has been
studied extensively. It may be done in a somewhat similar manner to equat-
ing elements of the transformation matrix. Another more elegant method
due to Junkins and Turner 1 yields a very nice result, here presented without
proof:
q0 = cos (θz /2) cos (θy /2) cos (θx /2) + sin (θz /2) sin (θy /2) sin (θx /2)
q1 = cos (θz /2) cos (θy /2) sin (θx /2) − sin (θz /2) sin (θy /2) cos (θx /2)
(3.8)
q2 = cos (θz /2) sin (θy /2) cos (θx /2) + sin (θz /2) cos (θy /2) sin (θx /2)
q3 = sin (θz /2) cos (θy /2) cos (θx /2) − cos (θz /2) sin (θy /2) sin (θx /2)
1
Junkins, J.L. and Turner, J.D., “Optional Continuous Torque Attitude Maneuvers,”
AIAA-AAS Astrodynamics Conference, Palo Alto, California, August 1978.
38 CHAPTER 3. COORDINATE SYSTEM TRANSFORMATIONS
{y}1 = A1 {x}1
the vector {x}1 to {x}2 = T2,1 {x}1 . Grouping terms we have the result,
T
A2 = T2,1 A1 T2,1 (3.9)
TF2 ,F1 θx θ y θz
TB,H φ θ ψ
(3.10)
TW,H µ γ χ
TB,W 0 α −β
−π≤θx < π
−π/2≤θy ≤ π/2 (3.11)
0≤θz < 2π
These ranges are most frequently used in flight dynamics, although occa-
sionaly one sees −π < θz ≤ π and 0 < θx ≤ 2π.