Graphics Programs Reference
In-Depth Information
u
u
P
C
θ
C
θ
P*
r
*
P*
φ
O
r
P
Q
(a)
(b)
Figure 1.26: A General Rotation.
Using Equations (A.3) and (A.5) (page 222), we can rewrite this as
r
∗
=(
uu
T
)
r
+
cos
θ
r
cos
θ
(
uu
T
)
r
+sin
θ
Ur
,where
−
⎛
⎞
0
−u
z
u
y
⎝
⎠
.
U
=
u
z
0
−
u
x
−
u
y
u
x
0
The result can now be summarized as
r
∗
=
Mr
,where
M
=
uu
T
+cos
θ
(
I
uu
T
)+sin
θ
U
−
(1.32)
⎡
⎤
u
x
+cos
θ
(1
−
u
x
)
u
x
u
y
(1
−
cos
θ
)
−
u
z
sin
θu
x
u
z
(1
−
cos
θ
)+
u
y
sin
θ
⎣
⎦
cos
θ
)+
u
z
sin
θu
y
+cos
θ
(1
u
y
)
=
u
x
u
y
(1
−
−
u
y
u
z
(1
−
cos
θ
)
−
u
x
sin
θ
.
u
x
u
z
(1
−
cos
θ
)
− u
y
sin
θu
y
u
z
(1
−
cos
θ
)+
u
x
sin
θu
z
+cos
θ
(1
− u
z
)
Direction cosines
.If
v
=(
v
x
,v
y
,v
z
) is a three-dimensional vector, its
direction
cosines
are defined as
v
x
|
v
|
v
y
|
v
|
v
z
|
v
|
N
1
=
,
N
2
=
,
N
3
=
.
These are the cosines of the angles between the direction of
v
and the three coordinate
axes. It is easy to verify that
N
1
+
N
2
+
N
3
=1. If
u
=(
u
x
,u
y
,u
z
)isaunitvector,
then
=1and
u
x
,
u
y
,and
u
z
are the direction cosines of
u
.
It can be shown that a rotation through an angle
|
u
|
θ
is performed by the transpose
M
T
. Consider the two successive and opposite rotations
r
∗
=
Mr
and
r
=
M
T
r
∗
.On
the one hand, they can be expressed as the product
r
=
M
T
r
∗
=
M
T
Mr
.Onthe
other hand, they rotate in opposite directions, so they return all points to their original
positions; therefore
r
must be equal to
r
.Weendupwith
r
=
M
T
Mr
or
MM
T
−
=
I
,
Search WWH ::
Custom Search