Definition

The existence of complex numbers presented a question for mathematicians: if a complex number exists in a 2D complex plane, could there be a 3D equivalent?

Sir William Rowan Hamilton, among many other mathematicians of the 18th and 19th centuries, had been searching for the answer. Hamilton conjectured that a 3D complex number could be represented by the triple a+bi+cj, where i and j are imaginary quantities and square to 1. When he was developing the algebra for this triplet, the product of them raised a problem when expanded:

z1=a1+b1i+c1jz2=a2+b2i+c2jz1z2=(a1+b1i+c1j)(a2+b2i+c2j)=(a1a2b1b2c1c2)+(a1b2+b1a2)i+(a1c2+c1a2)j+b1c2ij+c1b2ji

The quantities ij and ji represented a problem for Hamilton. Even if ij=ji, we are still left with (b1c2c1b2)ij.

On October 16th, 1843, while he was walking with his wife along the Royal Canal in Ireland, he saw the solution as a quadruple instead of a triple. Instead of using two imaginary terms, three imaginary terms provided the necessary quantities to resolve products like ij.

Hamilton defined a quaternion q as:

q=s+ai+bj+ck,s,a,b,cRi2=j2=k2=ijk=1ij=k,jk=i,ki=jji=k,kj=i,ik=j

If a complex number i is capable of rotating points on the plane by 90, then perhaps a triple rotates points in space by 90. In the end, the triplet was replaced by a quaternion.

Notation

There are three ways of annotating a quaternion q:

(1)q=s+xi+yj+zk(2)q=s+v(3)q=[s,v](4)where s,x,y,zR,vR3and i2=j2=k2=ijk=1

Real Quaternion

A real quaternion has a zero vector term:

q=[s,0]

Pure Quaternion

A pure quaternion is a quaternion having a zero scalar term:

q=[0,v]

Quaternion Conjugate

Given:

q=[s,v]

The quaternion conjugate is defined as:

q=[s,v]

Quaternion Norm

The norm of a quaternion q=[s,v] is defined as the square root of the product of itself and its conjugate (the multiplication operation is defined later):

|q|=qq=s2+x2+y2+z2

Also note that:

|q|2=qq

Norm facts:

  • |qq|=|q||q|
  • |q|=|q|

Unit Quaternion

A unit quaternion is a quaternion of norm one given by:

(5)q=[s,λn^]s,λR,n^R3|n^|=1s2+λ2=1

Note: dividing a non-zero quaternion by its norm produces a unit norm quaternion.

Operations

Quaternion Product

Given two quaternions:

qa=[sa,a],a=xai+yaj+zakqb=[sb,b],b=xbi+ybj+zbk

The product qaqb is computed as follows:

qaqb=(sa+xai+yaj+zak)(sb+xbi+ybj+zbk)=(sasbxaxbyaybzazb)+(saxb+sbxa+yazbybza)i+(sayb+sbya+zaxbzbxa)j(6)+(sazb+sbza+xaybxbya)k

Replacing the imaginaries by the ordered pairs (which are themselves quaternion units):

i=[0,i],j=[0,j],k=[0,k],1=[1,0]

And substituting them in (6):

qaqb=(sasbxaxbyaybzazb)[1,0]+(saxb+sbxa+yazbybza)[0,i]+(sayb+sbya+zaxbzbxa)[0,j]+(sazb+sbza+xaybxbya)[0,k]

By doing some groupings:

qaqb=[sasbxaxbyaybzazb,sa(xbi+ybj+zbk)+sb(xai+yaj+zak)+(yazbybza)i+(zaxbzbxa)j+(xaybxbya)k]=[sasbab,sab+sba+a×b]

Now let’s compute the product qbqa:

qbqa=[sbsaba,sba+sab+b×a]

Note that the scalar quantity of both products is the same; however, the vector quantity varies (the cross product sign is changed). Therefore:

qaqbqbqa

This is an important fact to note since for complex numbers the product commutes; however, for quaternions, it doesn’t.

Product of a Scalar and a Quaternion

Let k be a scalar represented as a quaternion as qk=[k,0] and q=[s,v].

Their product is:

qkq=[k,0][s,v]=[ks,kv]

Note that this product is commutative.

Product of a Quaternion with Itself (Square of a Quaternion)

q=[s,v]q2=[s,v][s,v]=[s2vv,2sv+v×v]=[s2v2,2sv]=[s2(x2+y2+z2),2s(xi+yj+zk)]

Product of a Quaternion and Its Conjugate

Let q=[s,v].

qq=[s,v][s,v]=[s2+vv,sv+svv×v]=[s2+vv,0]=s2+x2+y2+z2

Note that this product commutes, i.e., qq=qq.

Product of Unit Quaternions

Given:

qa=[sa,a]qb=[sb,b]

Where |qa|=|qb|=1, the product is another unit-norm quaternion:

qc=[sc,c]

Where |qc|=1.

Product of Pure Quaternions

Let:

qa=[0,a]qb=[0,b]

The product qaqb is defined as:

qaqb=[ab,a×b]

Note that the resulting quaternion is no longer a pure quaternion as some information has propagated into the real part via the dot product.

Product of a Pure Quaternion with Itself (Square of a Pure Quaternion)

q=[0,v]q2=[0,v][0,v]=[vv,v×v]=[(x2+y2+z2),0]=|v|2

If q is a unit norm pure quaternion, then:

q2=1

Product of a Pure Quaternion with Its Conjugate

qq=qq=[0,v][0,v]=[vv,v×v]=[vv,0]=|v|2

Inverse of a Quaternion

By definition, the inverse q1 of q is:

qq1=[1,0]

To isolate q1, let’s pre-multiply both sides by $q^**:

qqq1=q|q|2q1=qq1=q|q|2

Quaternion Units

Given the vector v:

v=vv^,where v=|v|, and |v^|=1

Combining this with the definition of a pure quaternion:

q=[0,v]=[0,vv^]=v[0,v^]

It’s convenient to identify the unit quaternion as q^ (where v=1):

q^=[0,v^]

Let’s check if the quaternion unit i squares to the ordered pair [1,0]:

i2=[0,i][0,i]=[00ii,0i+0ii×i]=[|i|2,0]since i×i=0=[1,0]

Misc Operations

Taking the Scalar Part of a Quaternion

To isolate the scalar part of q, we could add q to it:

2S(q)=q+q