...one of the most highly
regarded and expertly designed C++ library projects in the
world.

— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards

Quaternions are a relative of complex numbers.

Quaternions are in fact part of a small hierarchy of structures built upon
the real numbers, which comprise only the set of real numbers (traditionally
named * R*), the set of
complex numbers (traditionally named

`y`

`yx = yx'`

`x`

`x'`

`x = x'`

One of the most important aspects of quaternions is that they provide an efficient
way to parameterize rotations in * R^{3}*
(the usual three-dimensional space) and

In practical terms, a quaternion is simply a quadruple of real numbers (α,β,γ,δ),
which we can write in the form * q = α + βi + γj + δk*,
where

`i`

`j`

`k`

`i`

An addition and a multiplication is defined on the set of quaternions, which
generalize their real and complex counterparts. The main novelty here is that
**the multiplication is not commutative** (i.e.
there are quaternions * x* and

`y`

`xy ≠ yx`

```
i*i =
j*j = k*k = -1
```

Quaternions (and their kin) are described in far more details in this other document (with errata and addenda).

Some traditional constructs, such as the exponential, carry over without too much change into the realms of quaternions, but other, such as taking a square root, do not.