# Chapter 51: Character Animation

## Dual Quaternions

Dual numbers form a number system similar to complex numbers. Whereas complex numbers involve a real and imaginary part, dual numbers involve a real and a dual part. Just like the imaginary part of a complex number is multiplied by $i$, the dual part of a dual number is multiplied by a new operator $\epsilon$ such that

Where $z$ is the dual number, $r$ is the real part, and $d$ is the dual part.

A dual number is a number formed with two quaternions - a real quaternion and a dual quaternion, such that:

Where $q$ is the dual quaterion, $q_r$ is a quaternion representing the real part and $q_d$ is a quaternion representing the dual part.

It turns out that a dual quaternion can be used to represent a composite rotation and translation. The real part of the dual quaternion represents the rotation in standard quaternion form. The imaginary part represents the translation multipled by the rotation:

Where $t$ is a quaternion formed by:

Which is the standard way of representing a translation as a quaternion.

So what does this get us? Well, we ordinary use 4x4 matrices to represent arbitrary transformations in 3D space. However, there are a lot of times where we want rotational and translation components but we don’t have any scale. A composite rotation and translation is sometimes called a rigid transform.

If we’re implementing rigid body physics, we might only need rotation and translation for each object in the simulation. In character hierarchies, we very commonly have only rotation and translation for each joint configuration. Using dual quaternions in these situations gives us a compact representation (8 floats) for something we might ordinarly need 16 floats for.

In addition, there are some techniques based on dual quaternions. For example, dual quaternion skinning is an alternative to standard linear blend skinning that avoids certain artifacts.