Graphics Reference
In-Depth Information
Note that
(
v
ˆ
×
u
)
· ˆ
v
=
0
and
ˆ
×
× ˆ
=
ˆ
· ˆ
−
· ˆ
ˆ
=
−
· ˆ
ˆ
(
v
u
)
v
(
v
v
)
u
(
u
v
)
v
u
(
u
v
)
v
.
Therefore,
qpq
−
1
=
λ
2
(
ˆ
+
s
2
u
−
λ
2
u
+
λ
2
(
u
v
·
u
)
ˆ
v
+
2
λs
ˆ
v
×
u
· ˆ
v
)
ˆ
v
+
s
2
λ
2
u
2
λ
2
(
=
v
ˆ
·
u
)
v
ˆ
−
+
2
λs
v
ˆ
×
u
.
Obviously, this is a pure quaternion as there is no scalar component. However, it is
not obvious where the angle doubling comes from. But, look what happens when
we make
s
=
=
cos
θ
and
λ
sin
θ
:
+
cos
2
θ
sin
2
θ
u
qpq
−
1
2sin
2
θ(
ˆ
ˆ
ˆ
=
v
·
u
)
v
−
+
2sin
θ
cos
θ
v
×
u
=
(
1
−
cos 2
θ)(
v
ˆ
·
u
)
v
ˆ
+
cos 2
θ
u
+
sin 2
θ
v
ˆ
×
u
.
The double angle trigonometric terms emerge! Now, if we want this triple to actually
rotate the vector by
θ
, then we must build this in from the outset by halving
θ
in
q
:
q
=
cos
(θ/
2
)
+
sin
(θ/
2
)
ˆ
v
which makes
qpq
−
1
=
(
1
−
cos
θ)(
v
ˆ
·
u
)
v
ˆ
+
cos
θ
u
+
sin
θ
v
ˆ
×
u
.
(11.1)
Equation (
11.1
) is the same equation we came across in Chap. 9 discovered by
Rodrigues a few years before Hamilton, hence the scandal!
Let's test (
11.1
) using the previous example where we rotated a vector
u
=
2
i
,
1
1
ˆ
90° about the quaternion's vector
v
=
√
2
i
+
√
2
k
:
1
√
2
k
√
2
j
2
√
2
1
√
2
qpq
−
1
=
i
+
+
√
2
j
=
i
+
+
k
which agrees with the previous result.
Thus, when a quaternion takes on the form
ˆ
q
=
cos
(θ/
2
)
+
sin
(θ/
2
)
v
it rotates a vector
p
, anticlockwise
θ
using the triple
qpq
−
1
.
It can be shown that this triple always preserves the magnitude of the rotated vector.
You may be wondering what happens if the triple is reversed to
q
−
1
pq
? A guess
would suggest that the rotation sequence is reversed, but let's see what an algebraic
solution predicts: