On-Line Computer Graphics Notes
QUATERNIONS

Overview

The quaternion number system was discovered by Hamilton, a physicist who was looking for an extension of the complex number system to use in geometric optics. Quaternions have developed a wide-spread use in computer graphics and robotics research because they can be used to control rotations in three dimensional space. In these notes we define and review the basic properties of quaternions.

What are Quaternions?

Remember complex numbers? These numbers are an extension of the real number system and can be written in the form , where and are both real numbers and . The quaternions are just an extension of this complex number form.

A quaternion is usually written as

where , , and are scalar values, and , and are the unique quaternions with the properties that

and

This is clearly an extension of the complex number system - where the complex numbers are those quaternions that have and the real numbers are those that have .

Addition of quaternions is very straightforward: We just add the coefficients. That is, if and , then the sum of the two quaternions is

Multiplication is somewhat more complicated, as we must first multiply componentwise, and then use the product formulas for , , and to simplify the resulting expression. So the product of and is

An Alternate Representation for Quaternions

The expression for multiplication of quaternions, given above, is quite complex - and results in even worse complexity for the division and inverse formulas. The quaternions can be written in an different form - one which involves vectors - which dramatically simplifies the formulas. These expressions have become the preferred form for representing quaternions.

In this form, the quaternion is written as

where is the vector .

We can rewrite the addition formula for two quaternions and as

and the product formula as

With some algebraic manipulation, these formulas can be shown to be identical with those of the , , representation. We note that the quaternions of the form can be associated with the real numbers, and the quaternions of the form can be associated with the complex numbers.

Properties of Quaternions

With this new representation, it is straightforward to develop a complete set of properties of quaternions.

Given the quaternions , , and , we can verify the following properties.

• Addition - The sum of and is

• Negation - The additive inverse of is a

• Subtraction - The difference of and is

• Multiplication - The product of and is

• Identity - The multiplicative identity is . This can be directly checked by

• Multiplicative Inverse - The inverse of is given by

This can be checked easily once we calculate that

and so .
• Division - The quotient of and is

Notation

Quaternions of the form are normally denoted in their real number form - as . this allows a scalar multiplication property to be given by

• Scalar Multiplication - If is a scalar, then

It also allows us to simplify some expressions. For example, the expression for the multiplicative inverse can now be written
• Multiplicative Inverse - The inverse of is given by

This also allows us to write the multiplicative identity of the quaternions as instead of , and the additive identity as 0.

The Quaternions are not Commutative under Multiplication

Whereas we can add, subtract, multiply and divide quaternions, we must always be aware of the order in which these operations are made. This is because quaternions do not commute under multiplication - in general .

To give an example of this consider the two quaternions and . Multiplying these we obtain

or

and they are not equal. This is because the vector cross products give different results depending on the order of the vectors - in general, .

Length of a Quaternion, Unit Quaternions

We define the length of a quaternion to be

where is the length of the vector . The unit quaternions are those that have length one.

This document maintained by Ken Joy