Processing & Properties of Floor and Wall Tiles.pptx
The rotation matrix (DCM) and quaternion in Inertial Survey and Navigation System
1. 1
Inertial Survey and Navigation System
Assignment 1
Name : Muhammad Irsyadi Firdaus
Student ID : P66067055
1. Please explain (1) the rotation matrix (DCM) and (2) quaternion as much as you can.
The rotation matrix (DCM)
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 (𝑥𝑥, 𝑦𝑦, 𝑧𝑧) and the body-fixed axes by (𝑥𝑥′
𝑦𝑦′
𝑧𝑧′
), let 𝜃𝜃𝑥𝑥′,𝑦𝑦be, for
example, the unsigned angle between the 𝑥𝑥′
-axis and the 𝑦𝑦′
-axis. In terms of these angles,
the rotation matrix may be written
𝑅𝑅 = �
𝑐𝑐𝑐𝑐𝑐𝑐(𝜃𝜃𝑥𝑥′,𝑥𝑥) 𝑐𝑐𝑐𝑐𝑐𝑐(𝜃𝜃𝑥𝑥′,𝑦𝑦) 𝑐𝑐𝑐𝑐𝑐𝑐(𝜃𝜃𝑥𝑥′,𝑧𝑧)
𝑐𝑐𝑐𝑐𝑐𝑐(𝜃𝜃𝑦𝑦′,𝑥𝑥) 𝑐𝑐𝑐𝑐𝑐𝑐(𝜃𝜃𝑦𝑦′,𝑦𝑦) 𝑐𝑐𝑐𝑐𝑐𝑐(𝜃𝜃𝑦𝑦′,𝑧𝑧)
𝑐𝑐𝑐𝑐𝑐𝑐(𝜃𝜃𝑧𝑧′,𝑥𝑥) 𝑐𝑐𝑐𝑐𝑐𝑐(𝜃𝜃𝑧𝑧′,𝑦𝑦) 𝑐𝑐𝑐𝑐𝑐𝑐(𝜃𝜃𝑧𝑧′,𝑧𝑧)
�………………………………………………………………….. Equation 1
To illustrate this with a concrete example, consider the case shown in Fig. 1. Here, 𝜃𝜃𝑥𝑥′,𝑥𝑥 =
𝜃𝜃𝑦𝑦′,𝑦𝑦 = 𝛼𝛼 , 𝜃𝜃𝑥𝑥′,𝑦𝑦 =
𝜋𝜋
2
− 𝛼𝛼 , 𝜃𝜃𝑦𝑦′,𝑥𝑥 =
𝜋𝜋
2
+ 𝛼𝛼 , 𝜃𝜃𝑧𝑧′,𝑧𝑧 = 0 , and 𝜃𝜃𝑧𝑧′,{𝑥𝑥,𝑦𝑦} = 𝜃𝜃{𝑥𝑥′,𝑦𝑦′},𝑧𝑧 =
𝜋𝜋
2
.
Expanding Eq. 1,
𝑅𝑅 = �
cos(𝜃𝜃𝑥𝑥′,𝑥𝑥) cos(𝜃𝜃𝑥𝑥′,𝑦𝑦) 0
cos(𝜃𝜃𝑦𝑦′,𝑥𝑥) cos(𝜃𝜃𝑦𝑦′,𝑦𝑦) 0
0 0 1
�
=
⎣
⎢
⎢
⎢
⎡ cos(𝛼𝛼) cos(
𝜋𝜋
2
− 𝛼𝛼) 0
cos(
𝜋𝜋
2
+ 𝛼𝛼) cos(𝛼𝛼) 0
0 0 1⎦
⎥
⎥
⎥
⎤
= �
cos(𝛼𝛼) sin(𝛼𝛼) 0
− sin(𝛼𝛼) cos(𝛼𝛼) 0
0 0 1
�
The Direction Cosine Matrix (DCM) for each rotation individually is defined below:
2. 2
Euler-angle rotation sequence [Brown]
Yaw:
𝑅𝑅𝑍𝑍(𝜑𝜑) = �
cos 𝜑𝜑 sin 𝜑𝜑 0
−sin 𝜑𝜑 cos 𝜑𝜑 0
0 0 1
� = 𝑅𝑅3
Pitch:
𝑅𝑅𝑌𝑌(𝜃𝜃) = �
cos 𝜃𝜃 0 − sin 𝜃𝜃
0 1 0
sin 𝜃𝜃 0 cos 𝜃𝜃
� = 𝑅𝑅2
Roll:
𝑅𝑅𝑋𝑋(∅) = �
1 0 0
0 cos ∅ 𝑠𝑠𝑠𝑠𝑠𝑠 ∅
0 −𝑠𝑠𝑠𝑠𝑠𝑠 ∅ cos ∅
� = 𝑅𝑅1
One of the most common rotation sequence used in the aerospace field is the yaw-pitch-
roll sequence. The vehicle is first rotated about its 𝑍𝑍-axis by an angle 𝜑𝜑 (yaw). Then, it is
rotated about its new Y-axis by angle θ (pitch). Finally, the maneuvers is completed by a
rotation about the new X-axis by an angle ∅ (roll). 𝜑𝜑, 𝜃𝜃 and ∅ are the Euler angles.
Quaternion
Quaternions can be defined in several different, equivalent ways. It is helpful to know them
all, since each form is useful. 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.
Historically, quaternions were conceived by Hamilton as like extended complex numbers,
𝑤𝑤 + 𝑖𝑖𝑖𝑖 + 𝑗𝑗𝑗𝑗 + 𝑘𝑘𝑘𝑘 with 𝑖𝑖2
= 𝑗𝑗2
= 𝑘𝑘2
= −1, 𝑖𝑖𝑖𝑖 = 𝑘𝑘 = −𝑗𝑗𝑗𝑗, with real 𝑤𝑤, 𝑥𝑥, 𝑦𝑦, 𝑧𝑧. (In honor of
Hamilton, mathematicians denote the quaternions by H). Notice the non-commutative
multiplication, their novel feature; otherwise, quaternion arithmetic is pretty much like
real arithmetic. Hamilton was also quite aware of the more abstract possibility of treating
quaternions as simply quadruples of real numbers [𝑥𝑥, 𝑦𝑦, 𝑧𝑧, 𝑤𝑤 ], with operations of addition
and multiplication suitably defined. But, it happens that the components naturally group
into the imaginary part, (𝑥𝑥, 𝑦𝑦, 𝑧𝑧), for which Hamilton coined the term vector, and the purely
real part, which he called a scalar. Thus we usually will want to write a quaternion as [𝑣𝑣, 𝑤𝑤],
with 𝑣𝑣 = (𝑥𝑥, 𝑦𝑦, 𝑧𝑧). We will identify real numbers s with quaternions [0, 𝑠𝑠], and vectors
𝑣𝑣 ∈ 𝑅𝑅3 with quaternions [𝑣𝑣, 0]. Here are some basic facts.
3. 3
Notice that 𝑁𝑁(𝑞𝑞) is a scalar, so the description of 𝑞𝑞−1
is well defined. Otherwise, the
Non-commutativity of multiplication requires explicit expressions, such as 𝑝𝑝𝑞𝑞−1
, instead
of 𝑝𝑝 / 𝑞𝑞.
2. Given the rotation angle from a NED frame, please solve the parameters below.
𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟(∅) = 45.827°, 𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝ℎ(𝜃𝜃) = 12.346°, 𝑦𝑦𝑦𝑦𝑦𝑦(𝜑𝜑) = −198.542°
Note that each rotation sequence has its own corresponding DCM. Therefore a 1-2-3
rotation sequence will have a different DCM.
(1) DCM representation
The calculation using order 𝑋𝑋𝑋𝑋𝑋𝑋, it means that NED frame was rotated sequentially by 𝑍𝑍 −
𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎 (𝜑𝜑), 𝑌𝑌 − 𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎 (𝜃𝜃), 𝑎𝑎𝑎𝑎𝑎𝑎 𝑋𝑋 − 𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎 (∅).
4. 4
𝑅𝑅(∅ , 𝜃𝜃 , 𝜑𝜑) = 𝑅𝑅1 𝑅𝑅2 𝑅𝑅3 (the order is VERY important)
𝑅𝑅(∅ , 𝜃𝜃 , 𝜑𝜑) = 𝐷𝐷𝐷𝐷𝐷𝐷 = 𝑅𝑅𝑋𝑋(∅)𝑅𝑅𝑌𝑌(𝜃𝜃)𝑅𝑅𝑍𝑍(𝜑𝜑)
𝐷𝐷𝐷𝐷𝐷𝐷 = �
1 0 0
0 𝑐𝑐𝑐𝑐𝑐𝑐 ∅ 𝑠𝑠𝑠𝑠𝑠𝑠 ∅
0 −𝑠𝑠𝑠𝑠𝑠𝑠 ∅ 𝑐𝑐𝑐𝑐𝑐𝑐 ∅
� �
𝑐𝑐𝑐𝑐𝑐𝑐 𝜃𝜃 0 −𝑠𝑠𝑠𝑠𝑠𝑠 𝜃𝜃
0 1 0
𝑠𝑠𝑠𝑠𝑠𝑠 𝜃𝜃 0 𝑐𝑐𝑐𝑐𝑐𝑐 𝜃𝜃
� �
𝑐𝑐𝑐𝑐𝑐𝑐 𝜑𝜑 𝑐𝑐𝑐𝑐𝑐𝑐 𝜑𝜑 0
𝑐𝑐𝑐𝑐𝑐𝑐 𝜑𝜑 𝑐𝑐𝑐𝑐𝑐𝑐 𝜑𝜑 0
0 0 1
�……...…...Equation 2
𝐷𝐷𝐷𝐷𝐷𝐷 = �
𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 𝑐𝑐𝑐𝑐𝑐𝑐 𝜑𝜑 𝑐𝑐𝑐𝑐𝑐𝑐 𝜃𝜃 𝑠𝑠𝑠𝑠𝑠𝑠 𝜑𝜑 − 𝑠𝑠𝑠𝑠𝑠𝑠 𝜃𝜃
𝑠𝑠𝑠𝑠𝑠𝑠 ∅ 𝑠𝑠𝑠𝑠𝑠𝑠 𝜃𝜃 𝑐𝑐𝑐𝑐𝑐𝑐 𝜑𝜑 − 𝑐𝑐𝑐𝑐𝑐𝑐 ∅ 𝑠𝑠𝑠𝑠𝑠𝑠 𝜑𝜑 𝑠𝑠𝑠𝑠𝑠𝑠 ∅ 𝑠𝑠𝑠𝑠𝑠𝑠 𝜃𝜃 𝑠𝑠𝑠𝑠𝑠𝑠 𝜑𝜑 + 𝑐𝑐𝑐𝑐𝑐𝑐 ∅ 𝑐𝑐𝑐𝑐𝑐𝑐 𝜑𝜑 𝑐𝑐𝑐𝑐𝑐𝑐 𝜃𝜃 𝑠𝑠𝑠𝑠𝑠𝑠 ∅
𝑐𝑐𝑐𝑐𝑐𝑐 ∅ 𝑠𝑠𝑠𝑠𝑠𝑠 𝜃𝜃 cos 𝜑𝜑 + 𝑠𝑠𝑠𝑠𝑠𝑠 ∅ sin 𝜑𝜑 𝑐𝑐𝑐𝑐𝑐𝑐 ∅ 𝑠𝑠𝑠𝑠𝑠𝑠 𝜃𝜃 𝑠𝑠𝑠𝑠𝑠𝑠 𝜑𝜑 − 𝑠𝑠𝑠𝑠𝑠𝑠 ∅ 𝑐𝑐𝑐𝑐𝑐𝑐 𝜑𝜑 𝑐𝑐𝑐𝑐𝑐𝑐 𝜃𝜃 𝑠𝑠𝑠𝑠𝑠𝑠 ∅
�Equation 3
𝐷𝐷𝐶𝐶𝐶𝐶 = �
0.680713 −0.632628 0.369340
−0.700652 −0.709423 0.076195
0.213815 −0.310646 −0.926165
�
(2) The elements of Quaternion (clearly show which one is 𝑞𝑞0)
�
𝑞𝑞0
𝑞𝑞1
𝑞𝑞2
𝑞𝑞3
� = �
−0.106212
−0.910536
0.366070
−0.160113
�
(3) Show the image of axes after rotation.
Figure 1: Euler Angle Sequence (1,2,3)
3. Given the elements of Quaternion, please solve the parameters below.
[𝑞𝑞0 𝑞𝑞1 𝑞𝑞2 𝑞𝑞3] = [−0.425 − 0.0537 − 0.1950.782]
(1) DCM representation
𝐷𝐷𝐷𝐷𝐷𝐷 = �
−0.559433 −0.772764 −0.299783
0.823044 −0.475066 −0.311305
0.098148 −0.420889 0.901787
�
(2) Euler angle (with the axis order)
The function that maps a vector of Euler angles to its rotation matrix, and that same
function linearized, are 𝑅𝑅(∅ , 𝜃𝜃 , 𝜑𝜑) = 𝑅𝑅1 𝑅𝑅2 𝑅𝑅3
∅ = −124.2044480
𝜃𝜃 = 5.6325520
𝜑𝜑 = 25.0197860
5. 5
(3) Show the image of axis after rotation.
Figure 2: Euler Angle Sequence (1,2,3)
4. Given (roll = 90−𝜑𝜑°, pitch = 𝜆𝜆°, heading = 180−θ°) in a NED frame, solve the parameters
below. (show all the details of calculation)
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 ∅, 𝜃𝜃, 𝑎𝑎𝑎𝑎𝑎𝑎 𝜑𝜑 are known respectively
as roll, pitch, and yaw, or, equivalently, bank, attitude, and heading.
(1) DCM representation
The angles associated with the sequence (1; 2; 3) are sometimes called Cardan angles,
The function that maps a vector of Euler angles to its rotation matrix, and that same
function linearized, are (see Equation 3)
𝐷𝐷𝐷𝐷𝐷𝐷
= �
𝑐𝑐𝑐𝑐𝑐𝑐 λ° 𝑐𝑐𝑐𝑐𝑐𝑐(180 − θ°) 𝑐𝑐𝑐𝑐𝑐𝑐 λ° 𝑠𝑠𝑠𝑠𝑠𝑠 𝜑𝜑 − 𝑠𝑠𝑠𝑠𝑠𝑠 λ°
𝑠𝑠𝑠𝑠𝑠𝑠 (90 − φ°) 𝑠𝑠𝑠𝑠𝑠𝑠 λ° 𝑐𝑐𝑜𝑜𝑜𝑜 − 𝑐𝑐𝑐𝑐𝑐𝑐 (90 − φ°) sin(180 − θ°) 𝑠𝑠𝑠𝑠𝑠𝑠 (90 − φ°) 𝑠𝑠𝑠𝑠𝑠𝑠 λ° 𝑠𝑠𝑠𝑠𝑠𝑠 (180 − θ°) + 𝑐𝑐𝑐𝑐𝑐𝑐 (90 − φ°) 𝑐𝑐𝑐𝑐𝑐𝑐 𝜑𝜑 𝑐𝑐𝑐𝑐𝑐𝑐 λ° 𝑠𝑠𝑠𝑠𝑠𝑠(90 − φ°)
𝑐𝑐𝑐𝑐𝑐𝑐 (90 − φ°) 𝑠𝑠𝑠𝑠𝑠𝑠 λ° 𝑐𝑐𝑐𝑐𝑐𝑐 + 𝑠𝑠𝑠𝑠𝑠𝑠 (90 − φ°) sin(180 − θ°) 𝑐𝑐𝑐𝑐𝑐𝑐 (90 − φ°) 𝑠𝑠𝑠𝑠𝑠𝑠 λ° 𝑠𝑠𝑠𝑠𝑠𝑠 (180 − θ°) − 𝑠𝑠𝑠𝑠𝑠𝑠 (90 − φ°) 𝑐𝑐𝑐𝑐𝑐𝑐 𝜑𝜑 𝑐𝑐𝑐𝑐𝑐𝑐 λ° 𝑠𝑠𝑠𝑠𝑠𝑠(90 − φ°)
�
(2) The elements of Quaternion.
𝑞𝑞123(∅ , 𝜃𝜃 , 𝜑𝜑) =
⎣
⎢
⎢
⎢
⎢
⎢
⎢
⎢
⎡ cos
∅
2
cos
𝜃𝜃
2
𝑐𝑐𝑐𝑐𝑐𝑐
𝜑𝜑
2
+ 𝑠𝑠𝑠𝑠𝑠𝑠
∅
2
𝑠𝑠𝑠𝑠𝑠𝑠
𝜃𝜃
2
𝑠𝑠𝑠𝑠𝑠𝑠
𝜑𝜑
2
− cos
∅
2
sin
𝜃𝜃
2
𝑠𝑠𝑠𝑠𝑠𝑠
𝜑𝜑
2
+ cos
𝜃𝜃
2
cos
𝜑𝜑
2
𝑠𝑠𝑠𝑠𝑠𝑠
∅
2
cos
∅
2
cos
𝜑𝜑
2
𝑠𝑠𝑠𝑠𝑠𝑠
𝜃𝜃
2
+ sin
∅
2
cos
𝜃𝜃
2
𝑠𝑠𝑠𝑠𝑠𝑠
𝜑𝜑
2
cos
∅
2
cos
𝜃𝜃
2
sin
𝜑𝜑
2
− sin
∅
2
cos
𝜑𝜑
2
𝑠𝑠𝑠𝑠𝑠𝑠
𝜃𝜃
2 ⎦
⎥
⎥
⎥
⎥
⎥
⎥
⎥
⎤
6. 6
𝑞𝑞123(∅ , 𝜃𝜃 , 𝜑𝜑) =
⎣
⎢
⎢
⎢
⎢
⎢
⎢
⎡ cos
90 − φ°
2
cos
λ°
2
𝑐𝑐𝑐𝑐𝑐𝑐
180 − θ°
2
+ 𝑠𝑠𝑠𝑠𝑠𝑠
90 − φ°
2
𝑠𝑠𝑠𝑠𝑠𝑠
λ°
2
𝑠𝑠𝑠𝑠𝑠𝑠
180 − θ°
2
− cos
90 − φ°
2
sin
λ°
2
𝑠𝑠𝑠𝑠𝑠𝑠
180 − θ°
2
+ cos
λ°
2
cos
180 − θ°
2
𝑠𝑠𝑠𝑠𝑠𝑠
90 − φ°
2
cos
90 − φ°
2
cos
𝜑𝜑
2
𝑠𝑠𝑠𝑠𝑠𝑠
λ°
2
+ sin
90 − φ°
2
cos
λ°
2
𝑠𝑠𝑠𝑠𝑠𝑠
180 − θ°
2
cos
90 − φ°
2
cos
λ°
2
sin
180 − θ°
2
− sin
90 − φ°
2
cos
180 − θ°
2
𝑠𝑠𝑠𝑠𝑠𝑠
λ°
2 ⎦
⎥
⎥
⎥
⎥
⎥
⎥
⎤
References
Diebel. James, 2006, Representing Attitude: Euler Angles, Unit Quaternions, and Rotation
Vectors, Stanford University.
Shoemake. Ken, Quaternions, Department of Computer and Information Science, University
of Pennsylvania: Philadelphia.
Appendix
1. Answer to question 1
2. Answer to question 1