Graphics Reference
In-Depth Information
then
¯
=
+
−
q
v
q
x cos
x sin
i
i
cos
sin
i
+
y cos
−
z sin
j
+
z cos
+
y sin
k
cos
−
sin
i
and
=
x cos
2
x sin
2
i
q
v
¯
q
+
+
y cos
−
z sin
j
+
z cos
+
y sin
k
cos
−
sin
i
(7.13)
Equation (7.13) then simplifies to
¯
=
+
−
+
+
−
sin
i
(7.14)
which seems to have done the trick. Unfortunately, the remaining
j
and
k
terms have been
modified, so let's expand Eq. (7.14):
q
v
q
x
i
y cos
z sin
j
z cos
y sin
k
cos
q
v
q
¯
=
x
i
+
y cos
j
−
z sin
j
cos
−
sin
i
+
z cos
k
+
y sin
k
cos
−
sin
i
z sin
2
k
y cos
2
j
q
v
q
¯
=
x
i
+
+
y cos sin
k
−
z cos sin
j
−
z cos
2
k
y sin
2
j
+
−
z cos sin
j
+
y cos sin
k
−
Collecting like terms gives
+
y cos
2
2z cos sin
j
+
z cos
2
2y cos sin
k
y sin
2
z sin
2
¯
=
−
−
−
+
q
v
q
x
i
and substituting some trigonometric identities, we obtain
q
v
q
¯
=
x
i
+
y cos 2
−
z sin 2
j
+
z cos 2
+
y sin 2
k
(7.15)
and a pure rotation transform emerges with the rotation angle doubled:
cos 2
y
z
sin 2
sin 2 cos 2
−
As the original quaternion product had the form
q
v
¯
q
=
cos
+
sin
i
v
cos
−
sin
i
and the subsequent rotation was about the x-axis, it seems reasonable to assume that a rotation
about the y- and z-axes is achieved by
q
v
q
¯
=
cos
+
sin
j
v
cos
−
sin
j
and
q
v
q
¯
=
cos
+
sin
k
v
cos
−
sin
k
respectively, which is the case, and can be proved by repeating the above analysis with these
quaternions.
For consistency, the vector
v
is represented as a pure quaternion where the real part is zero:
0
+
v
. So, a rotation about an axis is achieved by
=
cos
2
sin
2x
i
z
k
0
v
cos
2
sin
2x
i
z
k
qv
q
¯
+
+
y
j
+
+
−
+
y
j
+
(7.16)
where the axis of rotation is represented by a unit vector.
The above analysis has not been very rigorous; nevertheless, hopefully, it has shown that the
algebra of quaternions is reasonably straightforward.