Graphics Reference
In-Depth Information
Example 1
For the sake of simplicity, let's make the y-axis the axis of rotation and the angle of rotation
180
. Thus, if the position vector
v
is
v
=
i
+
2
j
the rotating quaternions are
q
=
0
+
j
and
¯
q
=
0
−
j
Note that the axis of rotation is represented by a unit vector.
Figure 7.6 illustrates this scenario.
(-1,2,0)
Y
(1,2,0)
v
′
v
Z
X
Figure 7.6.
Applying Eq. (7.23), we have
¯
=
cos 90
+
sin 90
j
0
+
+
2
j
cos 90
−
sin 90
j
qv
q
i
qv
q
¯
=
0
+
j
0
+
i
+
2
j
0
−
j
qv
¯
q
=
−
2
−
k
0
−
j
qv
¯
q
=
0
+
2
j
−
i
Rearranging the terms gives
qv
¯
q
=
0
−
i
+
2
j
The vector part is
−
i
+
2
j
which makes the rotated point
−
120, which is correct.