Geometry
(and other perversions)

DigiPen main page Geometry main page

Quaternions

quaterions

The complex numbers can be thought of an extension of the real numbers by the inclusion of the imaginary number i, whose defining property is i2 = -1 (note that there is no real number whose square is a negative number, so i cannot be a real number).  The quaternions take this idea one step (actually two steps) further by postulating the existance of two additional imaginary numbers j and k; the square of each also being -1:

i2 = -1,      j2 = -1,   and   k2 = -1.

The quaternions are then defined to be the set of numbers q that are expressible in the form

q = a + bi + cj + dk,

where a,b,c,d are real numbers.

Quaternion arithmetic

quaterion calculator

Addition of quaternions is simple: we add coefficients of like terms.  For example,

(5 + 3i - 4k)  + (2 - i + 8j + 6k)
   =  (7 + 2) + (3 - 1)i +  (0 + 8)j + (-4 + 6)k
   =  9 + 2i + 8j + 2k.

On the other hand, to multiply two quaternions, we need to define what products of the form ij, ik, et cetera, should be.  One then stipulates that the imaginary numbers i, j, and k satisfy the relations

ij = k,      ik = -j,      jk = i,
ji = -k,      ki = j,      kj = -i.

For example, we can use these relations to compute

(2 + i - 3k)(1 + 5j)
   =  (2)(1) + (2)(5j) + (i)(1) +  (i)(5j) + (-3k)(1) + (-3k)(5j)
   =  2 + 10j + i + 5k  - 3k + 15i
   =  2 + 16i + 10j + 2k.

Note in particular that multiplication of quaternions is noncommutative: changing the order of multiplication of two quaternions results in different numbers.  Indeed, one computes that

(1 + 5j)(2 + i - 3k)  = 2 - 14i + 10j - 8k,

which is not equal to our previous computation.

All that and division too

division?

We may also divide quaternions; however, since quaternion multiplication is noncommutative, a little care is required.  It is not difficult to show that the following formula gives the inverse of a (nonzero) quaternion:

(a + bi + cj + dk)-1  =  (a2 + b2 +  c2 + d2)-1 (a - bi - cj - dk).

As a simple example, we compute

(1 + j - 2k)-1
   =  [(1)2 + (1)2  + (-2)2]-1 (1 - j + 2k)
   =  (1/6) - (1/6)j + (1/3)k

using the above formula.  And we verify that this is indeed the inverse:

(1 + j - 2k) [(1/6) - (1/6)j + (1/3)k]
   =  (1/6) - (1/6)j + (1/3)k +  (1/6)j + (1/6)
         + (1/3)i - (1/3)k - (1/3)i  + (2/3)
   =  1.

We can now divide two quaternions: if p and q are quaternions with q nonzero, we form the products

q-1 p   and   p q-1.

The quantity on the left is called left division, and the quantity on the right is called right division; as with multiplication, these will not be equal in general.

For more information: Introduction to quaternions (PDF document)

Let's go nonlinear

warped grid

Pure imaginary quaternions, which are in the form bi + cj + dk, can be used to represent three-dimensional vectors.  And in so doing, it turns out that all of the linear transformations that one encounters: rotations, reflections, scalings, et cetera, can be conveniently described in terms of quaternion arithmetic.  However, since division of quaternions is defined, which is not the case with three-dimensional vectors, other nonlinear transformations can be concocted.

An interesting class of nonlinear transformations of complex numbers are the Moebius transformations, which are maps of the form

f(z) = (Az + B)/(Cz + D),

where A,B,C,D are complex numbers (transformations of this form are also called fractional linear transformations).  We may define quaternion Moebius transformations in an analogous manner; however, because of the noncommutativity of multiplication and division, several variations are possible.  For example,

f(q) = (Cq + D)-1 (Aq + B)

and

g(q) = (Aq + B) (qC + D)-1

are two such possibilities (there are eight total), where A,B,C,D are now quaternions.

For more information: Quaternion Moebius transforms (PDF document)

Show me the blobs!

Here are two graphical programs for viewing quaternion Moebius transformations.

moebius #1 The image of the unit sphere under a Moebius transformation is rotated in four-dimensions
moebius #2 Moving cubes and spheres are transformed via a Moebius transform

Copyright © 2016 by Jason Hanson and DigiPen Institute of Technology