Graphics Reference
In-Depth Information
Fig. 8.6
If the
X
-and
Y
-axes are assumed to be
unit vectors, their direction
cosines form the elements of
the rotation matrix
8.4 Direction Cosines
Direction cosines
are the cosines of the angles between a vector and the Cartesian
axes, and for a unit vector they are its components.
Figure
8.6
shows the rotated frame
X
Y
, and by inspection the direction cosines
for a vector lying on
X
are cos
β
and cos
(
90°
β)
, which can be rewritten as cos
β
and sin
β
. The direction cosines for a vector lying on
Y
are cos
(
90°
−
+
β)
and cos
β
,
which can be rewritten as
−
sin
β
and cos
β
. But these direction cosines cos
β
,sin
β
,
sin
β
and cos
β
are the four elements of the inverse rotation matrix
R
−
1
β
−
:
.
cos
β
sin
β
R
−
1
β
=
−
sin
β
cos
β
The top row contains the direction cosines for the
X
-axis and the bottom row con-
tains the direction cosines for the
Y
-axis. This relationship also holds in 3D. Conse-
quently, if we have access to these cosines we can construct a transform that relates
rotated frames of reference.
Figure
8.7
shows an axial system
X
Y
rotated 45°, and the associated transform
is
⎡
⎤
⎡
⎤
⎡
⎤
x
y
1
0
.
707
0
.
707
0
x
y
1
⎣
⎦
≈
⎣
⎦
⎣
⎦
.
−
0
.
707
0
.
707
0
0
0
1
Fig. 8.7
The four vertices of
the unit square shown in both
frames