Appendix/Mathematics/EulerAngles

From jetwiki
Jump to navigation Jump to search


Euler Angles

Here we will follow quite closely the online class notes prepared by Professor Mona Berciu, Department of Physics & Astronomy, University of British Columbia.

Basic Relations

In terms of the (black) unit vectors of the (X,Y,Z) Cartesian coordinate system shown in the left panel of Figure 1, we can specify the (red) vector, A, by the expression,

A=eX(AX)+eY(AY)+eZ(AZ)

where the three coefficients, (AX,AY,AZ), give the length (and ± direction) of each vector component. Alternatively, in terms of the (black) unit vectors of the (x1,x2,x3) Cartesian coordinate system shown in the right panel of Figure 1, the same (red) vector is specified by the expression,

A=e1(A1)+e2(A2)+e3(A3).

Figure 1

Berciu Figure 1a

Berciu Figure 1b

It is clear from the nature of unit vectors and vector dot-products that the value of the coefficient, A1 — which explicitly appears in the second of these two expressions — may be obtained from the dot product, e1A. The same must be true if we insert, for A, the first of the two expressions; that is to say,

A1=e1A

=

e1eX(AX)+e1eY(AY)+e1eZ(AZ).

Analogously, we can write,

A2=e2A

=

e2eX(AX)+e2eY(AY)+e2eZ(AZ),

A3=e3A

=

e3eX(AX)+e3eY(AY)+e3eZ(AZ).

This set of three relations therefore provides a generic way to express one set of Cartesian vector projections in terms of the other. When written in matrix form, the set becomes,

[A1A2A3]

=

[e1eXe1eYe1eZe2eXe2eYe2eZe3eXe3eYe3eZ][AXAYAZ]=R^[AXAYAZ].

Alternatively, we could "dot" the unit-vector triplet (eX,eY,eZ) into the vector, A, in which case it would be easy to demonstrate that mapping the other direction is accomplished via the relation,

[AXAYAZ]

=

R^1[A1A2A3],

where,

R^1

[eXe1eXe2eXe3eYe1eYe2eYe3eZe1eZe2eZe3].

Adopting the shorthand notation used in Berciu's class notes, we will define,

Abody[A1A2A3]

      and,      

AXYZ[AXAYAZ].

To be clear, these are not different vectors. They are, rather, two different coordinate representations of the same vector as illustrated in Figure 1. Using this notation, mapping from one representation to the other is accomplished via the compact expressions,

Abody=R^AXYZ

      or,      

AXYZ=R^1Abody.


Matrix Transpose:  By definition, a matrix M^ is the transpose of the matrix N^ — that is, M^=N^T — if mij=nji for all matrix-element indices, i,j. We recognize, therefore, that

R^1=R^T

      and,      

R^=[R^1]T.

Specifically, this means that all three diagonal elements (for which, i=j) are the same in R^ and R^1; but the locations of paired off-diagonal elements are swapped.

A Sequence of Rotations

It is quite generally true that we can transition/map/migrate from one set of orthogonal unit vectors — such as the (eX,eY,eZ) inertial/laboratory frame illustrated by the black arrows in the left panel of Figure 1 — to any other set of orthogonal unit vectors — such as the (e1,e2,e3) body frame illustrated by the black arrows in the right panel of Figure 1 — by carrying out three rotations. These are traditionally referred to as Euler angles. As is emphasized below, care must be taken when choosing the order in which rotations are carried out. One fairly standard sequence of rotations is illustrated in Figure 2:

Figure 2

Berciu Figure 2a

Berciu Figure 2b

Berciu Figure 2c

Rotation #1

Rotation #2

Rotation #3

First Rotation

As depicted in the left-most panel of Figure 2, rotate the triplet of unit vectors about the Z (i.e., eZ) axis by an angle, ϕ. The result is the green coordinate system labeled, (1,2,3). Note: (a) The 3' axis remains aligned with the inertial-frame Z-axis; and (b) we will refer to the 1' axis as the line of nodes. Given that the 3' axis is aligned with the Z-axis — that is, e3=eZ — it is easy to recognize that the other two mappings are:

e1=eXcosϕ+eYsinϕ,     and     e2=eYcosϕeXsinϕ.

Hence, the corresponding rotation matrix is,

R^3(ϕ)

=

[e1eXe1eYe1eZe2eXe2eYe2eZe3eXe3eYe3eZ]=[cosϕsinϕ0sinϕcosϕ0001].

Note that the subscript, 3, has been attached to R^ in order to indicate that rotation was about the "third" axis.

Second Rotation

As depicted in the center panel of Figure 2, rotate the triplet of unit vectors about the line of nodes by an angle, θ. The result is the light-blue coordinate system labeled, (1", 2", 3"). Note: (a) The 1" axis is aligned with the 1' axis (line of nodes); and (b) the values of the first pair of rotation angles, (ϕ,θ), have been chosen, here, to ensure that the 3" axis aligns with the e3 unit vector. Given that, e1=e1, the other two mappings are,

e2=e2cosθ+e3sinθ     and     e3=e3cosθe2sinθ.

The corresponding rotation matrix is, then,

R^1(θ)

=

[e1e1e1e2e1e3e2e1e2e2e2e3e3e1e3e2e3e3]=[1000cosθsinθ0sinθcosθ].

In this case the subscript, 1, has been attached to R^ in order to indicate that rotation was about the "first" axis.

Third Rotation

As depicted in the right-most panel of Figure 2, rotate the triplet of unit vectors about the 3" axis by an angle, ψ. The result is the desired black coordinate system labeled, (e1,e2,e3). Given that this step — like the first — calls for rotation about the "third" axis, we can immediately deduce that the relevant rotation matrix is,

R^3(ψ)

=

[cosψsinψ0sinψcosψ0001].

Other Properties of Particular Note

In her online class notes, Professor Berciu points out:

  1. R^3(ϕ1)R^3(ϕ2)=R^3(ϕ1+ϕ2). This means that if you rotate, first, by angle ϕ2 followed by a rotation by angle ϕ1 about the same axis(!), it is as if you carry out a single rotation by the angle, (ϕ1+ϕ2).
  2. In flipping the angle of rotation from positive to negative, the rotation matrix flips to its transpose. That is to say, for example, R^3(ϕ)=R^31(ϕ)=R^3T(ϕ).

Simple Numerical Example

Suppose we set (ϕ,θ,ψ)=(30,25,15), which are roughly consistent with the trio of rotation angles displayed in Figure 2. The corresponding trio of rotation matrices are:

R^3(ϕ)

=

[0.86600.500000.50000.86600001]

,      

R^1(θ)

=

[10000.90630.422600.42260.9063]

,      

R^3(ψ)

=

[0.96590.258800.25880.96590001].

Combined Transformations

Here, we combine the three rotations in the order defined by Figure 2 — and use the corresponding trio of Euler angles — to relate the three vector components of Abody to the three vector components of AXYZ. We first review how this can be accomplished via a standard — but rather brute force — unit-vector substitution approach; then we show how the more elegant matrix rotation technique can be employed to achieve the same result.

Brute Force

Bringing forward the results of our above discussion, we recognize that the following unit-vector relationships result from each of the three specified rotations:

Rotation #1:

e1=eXcosϕ+eYsinϕ     and     e2=eYcosϕeXsinϕ     and     e3=eZ;

Rotation #2:

e2=e2cosθ+e3sinθ     and     e3=e3cosθe2sinθ     and     e1=e1;

Rotation #3:

ex1=e1cosψ+e2sinψ     and     ex2=e2cosψe1sinψ     and     ex3=e3.

Hence, we have,

ex1

=

e1cosψ+e2sinψ

 

=

cosψ[e1]+sinψ[e2cosθ+e3sinθ]

 

=

cosψ[eXcosϕ+eYsinϕ]+sinψcosθ[eYcosϕeXsinϕ]+sinψsinθ[eZ]

 

=

eX[cosψcosϕsinϕsinψcosθ]+eY[cosψsinϕ+cosϕsinψcosθ]+eZ[sinψsinθ].

ex2

=

e2cosψe1sinψ

 

=

cosψ[e2cosθ+e3sinθ]sinψ[e1]

 

=

sinψ[eXcosϕ+eYsinϕ]+cosψcosθ[eYcosϕeXsinϕ]+cosψsinθ[eZ]

 

=

eX[sinψcosϕsinϕcosψcosθ]+eY[sinϕsinψ+cosϕcosψcosθ]+eZ[cosψsinθ].

ex3

=

e3

 

=

e3cosθe2sinθ

 

=

eZ[cosθ]sinθ[eYcosϕeXsinϕ]

 

=

eX[sinθsinϕ]eY[sinθcosϕ]+eZ[cosθ].

We can therefore write,

R^

[ex1eXex1eYex1eZex2eXex2eYex2eZex3eXex3eYex3eZ]

 

=

[(cosψcosϕsinϕsinψcosθ)(cosψsinϕ+cosϕsinψcosθ)(sinψsinθ)(sinψcosϕsinϕcosψcosθ)(sinϕsinψ+cosϕcosψcosθ)(cosψsinθ)(sinθsinϕ)(sinθcosϕ)(cosθ)].

Using Matrix Notation

Astrophysics Example
Euler Angles Example02

With more finesse, we can write the general rotation matrix that links the body frame, (x1,x2,x3), to the inertial/laboratory frame, (X,Y,Z), as the product of the three rotations about the corresponding axes:

R^(ϕ,θ,ψ)=R^3(ψ)R^1(θ)R^3(ϕ)

=

[cosψsinψ0sinψcosψ0001][1000cosθsinθ0sinθcosθ][cosϕsinϕ0sinϕcosϕ0001].

Berciu's online class notes, bottom of p. 3

Carrying out the matrix multiplications, starting from the right, gives,

R^(ϕ,θ,ψ)

=

[cosψsinψ0sinψcosψ0001][cosϕsinϕ0sinϕcosθcosθcosϕsinθsinθsinϕsinθcosϕcosθ]

 

=

[(cosψcosϕsinψsinϕcosθ)(sinϕcosψ+sinψcosθcosϕ)(sinψsinθ)(sinψcosϕsinϕcosθcosψ)(sinψsinϕ+cosψcosθcosϕ)sinθcosψsinθsinϕsinθcosϕcosθ].

This precisely matches the Euler-angle expression for the rotation matrix, R^, that we derived above using a more brute force approach.


For the simple numerical example established above, these three derivation steps give, respectively,

R^(ϕ,θ,ψ)

=

[0.96590.258800.25880.96590001][10000.90630.422600.42260.9063][0.86600.500000.50000.86600001]

 

=

[0.96590.258800.25880.96590001][0.86600.50000.45320.78490.42260.21130.36600.9063]

 

=

[0.71920.68610.10940.66190.62870.40820.21130.36600.9063].



Following the steps provided above, we recognize that the inverse — or transpose — of this rotation matrix is,

R^1=R^T

=

[(cosψcosϕsinψsinϕcosθ)(sinψcosϕsinϕcosθcosψ)(sinθsinϕ)(sinϕcosψ+sinψcosθcosϕ)(sinψsinϕ+cosψcosθcosϕ)(sinθcosϕ)(sinψsinθ)(sinθcosψ)(cosθ)].

From the last row of the column labeled "Proper Euler angles" in Wikipedia's discussion of the rotation matrix, we find,

Z1X2Z3

=

[(c1c3c2s1s3)(c1s3c2c3s1)(s1s2)(c3s1+c1c2s3)(c1c2c3s1s3)(c1s2)(s2s3)(c3s2)(c2)]

The equivalent expression can be found at the top of p. 4 of Professor Berciu's online class notes; it reads,

R^(ϕ,θ,ψ)

=

[(cosϕcosψcosθsinϕsinψ)(cosϕsinψcosθcosψsinϕ)(sinϕsinθ)(cosψsinϕ+cosϕcosθsinψ)(cosϕcosθcosψsinϕsinψ)(cosϕsinθ)(sinθsinψ)(cosψsinθ)(cosθ)]

These two rotation-matrix expressions are equivalent to one another, but they do not match our derived expression for R^. Instead, then match our expression for R^1. It is not (yet) clear to us why this is the case.


For the simple numerical example established above, the rotation matrix on the right-hand-side of both of these expressions gives,

[0.71920.66190.21130.68610.62870.36600.10940.40820.9063].

Extra Illustrations

For the most part, we have focused our discussion on the case where three simple rotations are carried out in the order depicted in Figure 2. This sequence — first ϕ (about the original Z axis), second θ (about the line of nodes), third ψ (about the new, tilted x3 axis) — has been denoted by the mathematical expression,

R^(ϕ,θ,ψ)=R^3(ψ)R^1(θ)R^3(ϕ).
Berciu's online class notes, bottom of p. 3

It is extremely important to appreciate that the order in which the rotations are carried out matters! On the right-hand-side of our adopted expression, the matrix that specifies the first rotation (ϕ) is placed farthest to the right, while the matrix that specifies the third/last rotation (ψ) is placed farthest to the left. In the paragraph that follows, we explicitly demonstrate that a different mapping arises if the first and third rotation matrices are swapped. But, as we shall illustrate, once the order of rotations has been specified, it doesn't matter whether the steps that are taken to combine matrix elements begins with multiplication of the first and second rotation matrices, or begins with multiplication of the second and third matrices.

The Order of Rotations Matters

Let's swap the order of the rotations that are identified in Figure 2 as #1 (ϕ) and #3 (ψ). The resulting combined matrix expression is,

R^3(ϕ)R^1(θ)R^3(ψ)

=

[cosϕsinϕ0sinϕcosϕ0001][1000cosθsinθ0sinθcosθ][cosψsinψ0sinψcosψ0001]

 

=

[cosϕsinϕ0sinϕcosϕ0001][cosψsinψ0sinψcosθcosθcosψsinθsinθsinψsinθcosψcosθ]

 

=

[(cosϕcosψsinϕsinψcosθ)(cosϕsinψ+sinϕcosθcosψ)(sinϕsinθ)(sinϕcosψcosϕsinψcosθ)(sinϕsinψ+cosϕcosθcosψ)(sinθcosϕ)(sinθsinψ)(sinθcosψ)(cosθ)].

This does not match the expression that was derived earlier for R^(ϕ,θ,ψ); nor does it match the inverse, R^1. This illustrates that the order of specified rotations does matter. It is worth pointing out that the diagonal elements of all of these rotation-matrix expressions are identical, but the off-diagonal terms differ.

Steps Taken to Combine Matrix Elements

In our above discussion, we carried out the multiplication of three rotation matrices — strategically combining the elements of various columns and rows — by starting from the right, that is, by first multiplying the 2nd and 3rd matrices. Here, beginning with the same expression for R^(ϕ,θ,ψ), we multiply the three matrices by starting from the left, that is, by first multiplying the 1st and 2nd matrices.


R^(ϕ,θ,ψ)=R^3(ψ)R^1(θ)R^3(ϕ)

=

[cosψsinψ0sinψcosψ0001][1000cosθsinθ0sinθcosθ][cosϕsinϕ0sinϕcosϕ0001]

 

=

[cosψsinψcosθsinψsinθsinψcosψcosθcosψsinθ0sinθcosθ][cosϕsinϕ0sinϕcosϕ0001]

 

=

[(cosψcosϕsinψcosθsinϕ)(cosψsinϕ+sinψcosθcosϕ)(sinψsinθ)(sinψcosϕcosψcosθsinϕ)(sinψsinϕ+cosψcosθcosϕ)(cosψsinθ)(sinθsinϕ)(sinθcosϕ)(cosθ)].


This is precisely the same result that we obtained previously, illustrating that once the order of the multiplications has been established, it doesn't matter how pairs of matrices are grouped in order to carry out the row-column multiplications.

Switching Coordinate Representations of a Vector

Now, given that,

Abody=R^AXYZ,

the following three mapping relations must hold:

A1

=

AX(cosψcosϕsinψsinϕcosθ)+AY(sinϕcosψ+sinψcosθcosϕ)+AZ(sinψsinθ),

A2

=

AX(sinψcosϕsinϕcosθcosψ)+AY(sinψsinϕ+cosψcosθcosϕ)+AZ(sinθcosψ),

A3

=

AX(sinθsinϕ)+AY(sinθcosϕ)+AZ(cosθ).

Alternatively, given that,

AXYZ=R^1Abody,

the following additional three mapping relations must hold:

AX

=

A1(cosψcosϕsinψsinϕcosθ)+A2(sinψcosϕsinϕcosθcosψ)+A3(sinθsinϕ),

AY

=

A1(sinϕcosψ+sinψcosθcosϕ)+A2(sinψsinϕ+cosψcosθcosϕ)+A3(sinθcosϕ),

AZ

=

A1(sinψsinθ)+A2(sinθcosψ)+A3(cosθ).


Extending the simple numerical example established above, let's assume that the (red) vector that appears in both panels of Figure 1 has the inertial-frame (left panel) components,

(AX,AY,AZ)=(0.8,0.8,0.9).

The components of this same (red) vector as viewed from the body frame (right panel of Figure 1) should be,

[A1A2A3]

=

R^[AXAYAZ]

 

=

[0.71920.68610.10940.66190.62870.40820.21130.36600.9063][0.80.80.9]

 

=

[1.22270.34080.6919].

Out of curiosity, what do we obtain if we use the inverse of the rotation matrix? Well …

[?1?2?3]

=

R^1[AXAYAZ]

 

=

[0.71920.66190.21130.68610.62870.36600.10940.40820.9063][0.80.80.9]

 

=

[0.23600.72241.2298].

Riemann Type I Ellipsoids

Tipped Coordinate System

In an accompanying discussion of Riemann Type I ellipsoids, we have presented a methodical derivation of orbital parameters in a "tipped" reference frame. In the context of our present discussion of Euler angles, it seems clear that this separate coordinate-frame transformation involved only one nonzero Euler angle; specifically, (ϕ,θ,ψ)=(0,θ,0). In terms of Euler angles, then, the transformation between the ellipsoid's unprimed frame and the primed "tipped" frame is given by the above expressions

[xyz]tipped

=

R^[xy(zz0)],

and,

[xy(zz0)]

=

R^1[xyz]tipped,

where,

R^(ϕ,θ,ψ)=R^3(ψ)R^1(θ)R^3(ϕ)

=

[100010001][1000cosθsinθ0sinθcosθ][100010001]

 

=

[1000cosθsinθ0sinθcosθ],

and,

R^1

=

[1000cosθsinθ0sinθcosθ].

That is to say,

x = x
y = ycosθ+(zz0)sinθ
z = ysinθ+(zz0)cosθ
x = x
y = ycosθzsinθ
(zz0) = ysinθ+zcosθ

which is identical to the coordinate transformations presented in the top two panels of the table in our accompanying methodical derivation of orbital parameters.

Similarly, the three components of the velocity field as viewed from the "tipped" plane can be obtained from the velocity components in the untipped plane (u1,u2,u3) via the expressions,

u1' = u1
u2' = u2cosθ+u3sinθ
u3' = u2sinθ+u3cosθ

Velocity in Tipped Plane

Now, according to EFE — see eq. 154 of Chapter 7, §51 (p. 156) —

u1

=

[a2a2+b2]ζ3y+[a2a2+c2]ζ2z

u2

=

+[b2a2+b2]ζ3x

u3

=

[c2a2+c2]ζ2x

Hence, in the "tipped" plane we find,

u1' =

[a2a2+c2]ζ2z[a2a2+b2]ζ3y

  =

[a2a2+c2]ζ2[z0+ysinθ+zcosθ]+[a2a2+b2]ζ3[zsinθycosθ],

u2' = cosθ[b2a2+b2]ζ3xsinθ[c2a2+c2]ζ2x
  =

{cosθ[b2a2+b2]ζ3sinθ[c2a2+c2]ζ2}x,

u3' = sinθ[b2a2+b2]ζ3xcosθ[c2a2+c2]ζ2x
  = {sinθ[b2a2+b2]ζ3cosθ[c2a2+c2]ζ2}x.

Ideally, we would like to choose the orientation of our "tipped" plane such that there are no vertical motions as viewed from that plane, that is, such that u3'=0. This means that,

sinθ[b2a2+b2]ζ3 =

cosθ[c2a2+c2]ζ2

tanθ =

ζ2ζ3[a2+b2a2+c2]c2b2.

Given, as well, that we are only analyzing motion in the z=0 plane, we have for the other two velocity components,

u2' =

cosθ{[b2a2+b2]ζ3tanθ[c2a2+c2]ζ2}x

  =

cosθ{[b2a2+b2]ζ3+ζ2ζ3[a2+b2a2+c2]c2b2[c2a2+c2]ζ2}x

  =

[b2a2+b2]ζ3cosθ{1+ζ22ζ32[a2+b2a2+c2]2c4b4}x

u1' =

cosθ{[a2a2+c2]ζ2[z0cosθ+ytanθ+z0]+[a2a2+b2]ζ3[z0tanθy]}

  =

[a2a2+c2]z0ζ2ζ3cosθ{[a2a2+c2]ζ22ζ32[a2+b2a2+c2]c2b2+[a2a2+b2]}y

  =

[a2a2+c2]z0ζ2[a2a2+b2]ζ3cosθ{ζ22ζ32[a2+b2a2+c2]2c2b2+1}y.

Rewrite Velocity-Component Expressions

After defining the term,

Λ2

ζ22ζ32[a2+b2a2+c2]2c2b2,

the expressions for the two "tipped" velocity components may be rewritten as,

[a2+b2ζ3cosθ]u2' =

{b2+Λ2c2}x,

[a2+b2ζ3cosθ]u1' =

[a2+b2ζ3cosθ][a2a2+c2]z0ζ2{a2+Λ2a2}y.

Or,

{1+Λ2b2+Λ2c2}[a2+b2ζ3cosθ]u2' =

(1+Λ2)x,

[a2+b2a2ζ3cosθ]u1' =

[a2+b2ζ3cosθ][z0ζ2a2+c2](1+Λ2)y

  =

(1+Λ2)(y0y),

where,

y0

11+Λ2[a2+b2ζ3cosθ][z0ζ2a2+c2].

Lagrangian Particle Motion

Now, if we assume that each Lagrangian particle executes a closed elliptical orbit in the plane of the tipped coordinate system (i.e., z=z˙=0 ), but whose orbit-center may be shifted by an amount, y0, away from the z'-axis, we expect …

x

=

xmaxcos(φt)

      and,      

yy0

=

ymaxsin(φt),

which implies,

x˙

=

xmaxφsin(φt)

      and,      

y˙

=

ymaxφcos(φt).

That is to say, we expect that the two velocity components will exhibit the form, respectively,

u1'

=

[xmaxymax]φ(y0y),

      and,      

u2'

=

[ymaxxmax]φx.

This pair of expressions will only match the underlying Riemann Type I flow if,

{1+Λ2b2+Λ2c2}[a2+b2ζ3cosθ]

=

xmaxymax,       and,

[a2+b2a2ζ3cosθ] =

ymaxxmax.

That is,

{1+Λ2b2+Λ2c2}[a2+b2ζ3cosθ]

=

[a2ζ3cosθa2+b2]

1a2{1+Λ2b2+Λ2c2}[a2+b2ζ3cosθ]2

=

1.

Let's try the numerical values from the example Type I ellipsoid used in an accompanying discussion, namely, b/a=1.25,c/a=0.4703,ζ2=2.2794,ζ3=1.9637.

Hence,

tanθ =

ζ2ζ3[a2+b2a2+c2]c2b2=0.3448θ=0.3320,

cosθ =

0.9454.

And,

Λ2

ζ22ζ32[a2+b2a2+c2]2c2b2=tan2θb2c2=0.8399.

Hence,

1a2{1+Λ2b2+Λ2c2}[a2+b2ζ3cosθ]2

=

{1.0524}[1.3803]2=2.005.

See Also


 

Tiled Menu

Appendices: | VisTrailsEquations | VisTrailsVariables | References | Ramblings | VisTrailsImages | myphys.lsu | ADS |