Hamilton’s Quaternions

Quaternions are generalized complex numbers that enable rotations in 3D rather than in just a complex plane. The complex number i is replaced by a general vector v which can be expressed in a 3D orthogonal basis i,j,k.

The rules are defined as ijk=-1 and any basis squared is also minus one, like ordinary complex numbers.

ij=k, jk=i, ki = j are the desired cyclic relations that motivate the above definition and follow from the definition, as can be seen by multiplying both sides by any single basis vector and applying the square rule.

So essentially, it combines the complex number rules with the rules of a cross product of vectors to come up with an elegant and useful mathematical structure.

Legend has it when Hamilton discovered them, he carved the rules into the side of the bridge he was walking on.

How is it useful for rotations you ask? Well, pick any quaternion of the form a+bv.

Here a and b are real numbers and v is a vector. We normalize the quaternion to the form cos(x)+sin(x)v.

This quaternion rotates vectors perpendicular to v by an angle x, about the rotation axis v. This is easily seen by just multiplying it out and observing the sine is perpendicular and cosine retains the input direction. But what happens to parallel components?

It does not work! So what do we do? Well parallel components should remain unaltered after rotation around the axis. So the formulation that Hamilton came up with to split up the rotation into two pieces:

(cos(x/2) + sin(x/2) v) (u) (cos(x/2) – sin (x/2) v)

The post multiplication by the conjugate ensures that when the parallel component commutes out.. the conjugate cancels the first factor. Hence the parallel vector remains unchanged after rotation.

But does this disrupt the original perpendicular vector? No, it still works. The perpendicular component is agnostic to the conjugation process and the two half angles add up to yield the full angle rotation. This can be proved by using the commutation rule ab = -ba, that applies to perpendicular vectors only ( derived from the basis rules). In this case, u and v are perpendicular.

So, given any input vector, it can be resolved to the sum of parallel and perpendicular components to the rotation axis and we can see the quaternion formulation works correctly!

Now we can conclude that this approach will work to formulate an axis-angle representation. Let me also mention Euler’s rotation theorem which states that any combination of 3D rotations can be reduced to rotation about an axis drawn from the origin. The particular axis might change based on the rotation sequence but the resulting transformation (final effect) is always so expressible.

Leave a comment

Design a site like this with WordPress.com
Get started