# Quaternions

← Back: Euler angles |
Overview: Quaternions |
Next: Basic properties of quaternions → |

Using homogeneous matrices for transformations is working well in theory. But practically there are several problems especially when multiple transformations are applied successively. First problem is, that matrix multiplication needs a lot of computations and thus computation time. Additionally no computer calculates a hundred percent correctly. So errors in matrix multiplication increase over time when multiple multiplications are calculated. This leads to matrices that are no longer orthonormal, which means that the three coordinate axes described by the matrix are not orthogonal anymore. So applying these matrices results in distorted transformations.

Furthermore rotation matrices can be defined with the 3 Euler angles. But using Euler angles can result in the loss of one degree of freedom. This so called Gimbal lock arises if two of the three rotation axes are parallel. Then two angles define the same rotation. For further information see the videos below.

Quaternions avoid these problems. They are an extension of real numbers to a four-dimensional number system using imaginary units. As quaternions have been described at first by William Rowan Hamilton, they are also called *Hamilton numbers*.

A quaternion consists of a *scalar part* with one component and a *vector part* with three components. The vector components are assigned to imaginary units, which is why they are also called the *imaginary part*. A quaternion can be written as

where and are imaginary units.

Often the four components of a quaternion are named correspondingly to the label of the quaternion itself. So assuming a quaternion the four components are also denoted with :

There is a second notation for quaternions, the vector notation, avoiding imaginary units. In this notation the operator concatenates the scalar and the vector part, which obviously cannot be added to each other. So on one side of the operator there is only the scalar part and on the other side only the vector part:

This can also also be denoted as

In the following subarticles all important aspects of quaternions are treated in detail:

- Basic properties of quaternions
- Pure and unit quaternions
- Addition of quaternions
- Multiplication of quaternions
- Rotations using quaternions
- Composition of rotations
- Realization of transformations