Game Development Reference
In-Depth Information
multiplication of two complex numbers
(cosθ + isinθ)(x + iy) = xcosθ + iy cosθ + ixsinθ + i 2 y sinθ
= (xcosθ − y sinθ) + i(xsinθ + y cosθ)
as performing a rotation. This is equivalent to the matrix multiplication
cosθ − sinθ
sinθ cosθ
x
y
xcosθ − y sinθ
xsinθ + y cosθ
=
.
While this a not much more that mathematical trivia so far, our goal is to
build up some parallels that we can carry forward to quaternions, so let's
repeat the key result.
In 2D, we can interpret the vector [x,y] as a complex number x + yi and
rotate it by using the complex multiplication (cosθ + isinθ)(x + iy).
A similar conversion from ordinary vectors to complex numbers is nec-
essary in order to multiply quaternions and 3D vectors.
Before we leave 2D, let's summarize what we've learned so far. Complex
numbers are mathematical objects with two degrees of freedom that obey
certain rules when we multiply them. These objects are usually written as
a + bi, but can equivalently be written as a 2 × 2 matrix. When we write
complex numbers as matrices, it begs the geometric interpretation of mul-
tiplication by i as a 90 o rotation. The rule i 2 = −1 has the interpretation
that combining two 90 o rotations yields a 180 o rotation, and that leaves us
with a warm fuzzy feeling. More generally, any complex number with unit
length can be written as cosθ + isinθ and interpreted as a rotation by the
angle θ. If we convert a 2D vector into complex form and multiply it by
cosθ + isinθ, it has the effect of performing the rotation.
It's very tempting to extend this trick from 2D into 3D. Tempting,
but alas not possible in the straightforward way. The Irish mathematician
William Hamilton (1805-1865) apparently fell victim to just this tempta-
tion, and had looked for a way to extend complex numbers from 2D to 3D
for years. This new type of complex number, he thought, would have one
real part and two imaginary parts. However, Hamilton was unable to create
a useful type of complex number with two imaginary parts. Then, as the
story goes, in 1843, on his way to a speech at the Royal Irish Academy,
he suddenly realized that three imaginary parts were needed rather than
two. He carved the equations that define the properties of this new type of
complex number on the Broom Bridge. His original marks have faded into
Search WWH ::




Custom Search