1. Introduction
We assume that the reader is familiar with the notion of pose and rigid motion, and the use of quaternions to represent rotations. We use the terms pose and rigid motion interchangeably, since a pose can be considered as a rigid motion relative to a fixed reference frame, and the mathematical operations to manipulate them are identical. Thus we also use the terms rotation and orientation interchangeably, and similarly with translation and position. We refer the reader to [4, 6].
The use of dual quaternions to represent poses is well established, especially in the graphic card industry: [1, 7, 5, 9, 10, 11, 16, 17, 18, 20]
. However, in the robotics industry, it is more common to represent a pose using a quaternion (for the rotation) and a three dimensional vector (for the translation). In this paper, we advocate for the use of dual quaternions.
Let us start with a general discussion of why people might want to represent rotations by unit quaternions instead of three by three orthogonal matrices with determinant . One reason given is that quaternions can be represented with only four numbers, whereas the matrix representation requires nine numbers. Another representation commonly used are Euler angles, and these only require three numbers. However, with Euler angles, the formula for composition of rotations is difficult to calculate. Also, Euler angles suffer from gimbal lock, in which if the rotation takes certain values, the choice of Euler angles isn’t unique, and discontinuities and singularities arise. Quaternions suffer from no such problems.
But in modern times, computer memory is very cost effective, and communication is fast, thus the aformentioned advantages might seem trivial at first. This begs the question: what other advantages do quaternions offer over matrices? Quaternions represent a quantity with three degrees of freedom by a four dimensional vector, whereas matrices use a nine dimensional vector. Suppose one obtains an approximation to a matrix or quaternion? For example, this would be common when using NewtonRaphson to find a rotation satisfying some formula, or to interpolate between rotations. So then one has to find a projection which takes the vector to an admissible vector, that is, a vector that actually represents a rotation. And projecting from a nine dimensional quantity to a three dimensional quantity is going to be much harder than the similarly projection from the four dimensional vector. (The projection from quaternions to unit quaternions is called the
normalization, and is defined in Section2. A suggestion of what such a projection would be for matrices is given at the end of Section 10.)For representing poses, the usual representation is by a three by three orthogonal matrix with determinant
for the rotation, and a three dimensional vector for the translation, twelve dimensional in all. This has a natural representation as a four by four matrix, as we explain Section 4. A great advantage of this representation is the relationship between pose and twist:(1) 
where the multiplication is matrix multiplication, and a twist is a combination of angular velocity and translational velocity measured with respect to the moving frame.
Another natural representation used a lot is to use a quaternion and a three dimensional vector. But this new representation has problems in that it is not clear how the above equation would work in this situation. However, if one introduces the notion of the dual quaternion, which is an eight dimensional vector, equation (1) is still valid if one uses dual quaternion multiplication.
A challenge with dual quaternions is that they are abstract, which can make them harder to understand. Mathematicians find value behind abstract computational ideas, but Engineers usually find the end result, ‘black box approach,’ more useful.
A useful approach to developing intuition for dual quaternions is to understand the rules with their structure, and the mathematical operations needed to manipulate them, (that is, normalization, basis vector multiplication, pose differentiation). Once one becomes comfortable with their form and function, the advantage of duel quaternions over other methods becomes more apparant. For example, one realizes that computing the projection of an eight dimensional vector to the six degrees of freedom of a pose, is also quite simple. (This projection is also called the normalization, and is defined in Section 3.)
This makes it very useful if one is using the NewtonRaphson Method to find a pose satisfying certain properties. We show how the dual quaternion representation efficiently solves the forward kinematics problem.
Finally we consider the dynamics of poses, that is, the equations of motion of a rigid spinning body. In any representation this can be quite difficult, because of both centripetal and precessional effects. But from a theoretical perspective, using the dual quaternion representation is quite slick.
In summary, while the usual representation using Euler angles and translations is conceptually easy to understand, performing calculations can be difficult. Whereas with dual quaternions, while the are initially conceptually hard to understand, when it comes to calculations they are much easier to work with.
2. Motivation
A pose, or rigid motion, is a rotation followed by a translation. (Semantically, a pose is the position of the end effector of the robot, and thus different from a rigid motion, but mathematically they are the same if we consider a pose to be a rigid motion with respect to the stationary reference frame.) The rotation is represented by a orthogonal matrix with determinant . A translation is a vector in . These represent the pose :
(2) 
Composition of poses is written from right to left. Thus
(3) 
One way to represent a pose is using a four by four matrix
(4) 
Then composition of poses may be computed simply by multiplying matrices of the form (4). In the literature, the Lie group of rotations is often denoted . The Lie group of poses is often denoted .
The problem with this representation is that twelve numbers are required to represent a pose. Other problems, which we discuss below, is that of interpolating a sequence of poses, and of computing forward kinematics.
One common way to solve both of these problems is to represent the rotation by a unit quaternion [2, 13], which we briefly describe here. A quaternion is a quadruple of real numbers, written as , with the algebraic operations . Its conjugate is , its norm is , its normalization is , its real part is , and its imaginary part is . It is called a unit quaternion if , a real quaternion if , and a pure quaternion if . Note the multiplicative inverse is given by .
We identify three dimensional vectors with pure quaternions, by identifying , , and with the three standard unit vectors. A unit quaternion represents the rotation . A rotation by angle about an axis , where , has two unit quaternion representations: . Composition of rotations corresponds to multiplication of unit quaternions. With some practice, it becomes easier to read a rotation from a quaternion than it does from Euler angles, the standard method of representing rotations.
We can represent quaternions as four dimensional vectors, and give it the inner product
(5) 
Then a way to represent poses is as a pair . This is the way poses are represented internally in the Robotic Operating System [15]. Then the composition rule is
(6) 
A difficulty with this is that the composition is not a bilinear operation as it was with the representation (4). (This lack of bilinear representation becomes particularly problematic when representing twists, which we describe below.) However there is a way to resolve this as follows. Write and . Then equation (6) can be rewritten as
(7)  
This leads to representing the pose by a unit dual quaternion, which we now describe.
3. Dual quaternions to represent poses
A dual quaternion is a pair of quaternions, written as , with the extra algebraic operation .
The conjugate dual quaternion of is . Conjugation reverses the order of multiplication:
(8) 
There is another conjugation for dual quaternions: , but we have no cause to use it in this paper, except in equation (19) below.
A unit dual quaternion is a dual quaternion such that , equivalently, that is a unit quaternion and . A pure dual quaternion is a dual quaternion such that both and are pure quaternions.
If is a dual quaternion with , then its multiplicative inverse can be calculated using the formula
(9) 
If is a unit dual quaternion, then there is a computationally much faster formula:
(10) 
For a dual quaternion , it is not really possible to mix and additively. The quaternion is unitless, whereas the quaternion has units of length. For this reason, when measuring how large a dual quaternion is, everything must be with respect to , the characteristic length scale. The size of a dual quaternion is defined to be
(11) 
A dual number is anything of the form , where and are real numbers. The norm of a dual quaternion is the dual number defined by the two steps:
(12)  
(13) 
The norm preserves multiplication, that is, if and are two dual quaternions, then
(14) 
If is any dual quaternion with , then we define its normalization to be the unit dual quaternion
(15) 
(We remark that the normalization of a dual quaternion is used in the computer graphics industry [9, 10].) While this normalization formula might seem initially quite complicated, after thinking about it one can see that it is the simplest projection that enforces and .
The normalization also satisfies the following properties.

If is a unit dual quaternion, then .

Normalization preserves multiplication, that is, if and are two dual quaternions, then
(16)
Note that
(17) 
and this could have been the definition of the multiplicative inverse of a dual quaternion, except that this definition is circular.
We set for the set of dual quaternions, for the set of unit dual quaternions, and for the set of pure dual quaternions.
If we are given a pose represented by , then the pose is also represented by the unit dual quaternion
(18) 
As we have shown above, composition of poses corresponds to multiplication of unit dual quaternions. If is a 3vector, and is the image of under the action of the pose , then
(19) 
but generally it is easier to use the formula
(20) 
The introduction of the factors and is unnecessary, but it slightly improves formulas for the twist, as we see below.
It is difficult for a human to look at the second part of a unit dual quaternion, and from that read what the translational part of the pose should be. So dual quaternions work better for an internal representations of poses rather than human readable representations.
4. Kinematics: dual quaternions to represent twists
The translational velocity of a translating reference frame is given by . The angular velocity of a rotating frame is given by the differential equation
(21) 
or , where is the Hodge star operator of [19]:
(22) 
(Equation (21) gives the angular velocity with respect to the rotating reference frame. If one wants the angular velocity with respect to the stationary reference frame, use instead .)
Note that
(23) 
where denotes the cross product.
A twist is the pair of vectors that describe the change of pose in the moving reference frame, that is:
(24) 
(Note in particular that , so that a continual application of a twist can result in a motion following a straight line, an arc of a circle, or a spiral.) The set of angular velocities, and the set of twists are both Lie algebras, often denoted by and in the literature.
The quaterniontranslation formulation doesn’t have a representation like equation (1):
(25) 
But with the unit dual representation, because the composition of poses is given by a bilinear multiplication, it follows that the twist is represented by the dual quaternion satisfying the differential equation.
(26) 
It will be shown in Section 9 (see also [7, 18]) that is the pure dual quaternion
(27) 
Note that if is a unit dual quaternion that is a function of time , then is always a pure dual quaternion. (Note that is a pure dual quaternion equal to the twist relative to the fixed frame of reference. Note also that the factor attached to in equation (27) is a consequence of the introduction of the factor in equation (18), and thus is essentially arbitrary.)
5. Dual quaternions to represent wrenches
Let the pose represent the reference frame that moves with the end effector. It is not necessary (although it can simplify things) that the center of mass of the end effector coincides with the origin of the moving frame.
The wrench dual quaternion is defined to be
(28) 
where and are the torque and force, respectively, applied to the end effector at the origin of the moving frame, measured with respect to the moving frame.
If is the center of mass of the end effector in the moving frame, then the twist about the center of mass is given by
(29) 
where , and the wrench applied about the center of mass is
(30) 
The reason for introducing the factor in definition (28) is so that the rate of change of work done to the end effector is given by
(31) 
See [3] for the origins of the term twist and wrench as pairs of 3vectors, which are examples of screws.
6. Interpolation of poses
Suppose that we are given a sequence of times and rotations, and . We would like to find a function from to rotations such that the third derivative of is bounded, and . If the quantities were merely vectors, we could use cubic splines. But if we perform a similar calculation on the matrices, we cannot guarantee that the matrix is a rotation matrix.
So what we want is to find a map that projects general matrices onto rotation matrices. But it is not obvious how to find such a map that is computationally efficient. It is here that using quaternions really has great advantages over matrices, because an obvious map from general quaternions to unit quaternions is to normalize.
Let be the quaternion representation of respectively. Let be the cubic spline interpolation such that . Then
(32) 
provides a computationally fast, low jerk, method of interpolating the rotations.
This can be extended to interpolate poses. Given times and unit dual quaternions , first interpolate to get a function such that , and then normalize it to get a function . This gives a computationally fast, low jerk, method for interpolating poses.
It is perhaps better to interpolate the rotation quaternions and the translations separately. This is because the center of gravity typically travels in a straight line rather than the arc of a curve, but naive interpolation of dual quaternions follows arcs of curves if the angular rotation is nonzero. (Interpolation of dual quaternions is more appropriate for ‘skinning’ [9, 10].)
If one wants to find a function that passes through these points, and has low jerk even at the end points and , this can be done by adding a ‘ramp up’ and ‘ramp down’ at the ends of the trajectory. Create a free cubic spline on and . Then define a function
(33) 
where
(34) 
Since , , and , it follows that has bounded third derivative, for , for , and for . Thus
(35) 
provides a low jerk function, even at the end points, that passes through the appropriate points. it is important that and be large enough to allow the trajectory to ‘ramp up’ and ‘ramp down’ smoothly.
7. Perturbations of poses
Suppose one has a pose that varies in time, and a fixed time . Then we would like to find a good representation of the perturbation of from a reference pose when is close to . One way to do this is to choose a new reference frame in which , the identity pose, or rather, to think about how behaves.
It can be seen that for close to that there is a pure dual quaternion such that
(36) 
Thus
(37) 
gives a great way to measure the perturbation.
We prefer instead to use what we shall call the Lie difference, which we denote using , which is close to (37), but is always a pure dual quaternion:
(38) 
Note that if and are pure dual quaternions, and is an invertible dual quaternion, then
(39) 
This gives a great way to map perturbations of nonlinear poses to linear twists. These can be very effective in control theory.
8. Spherical linear interpolation of dual quaternions
Suppose we are given two unit dual quaternions, and ? The problem is to find the dual quaternion valued function of time, denoted , such that at , it takes the value , that at , it takes the value , and such that its twist, , is a constant pure dual quaternion. The name of the function, ‘slerp’, comes from the equivalent problem for orientations [14].
This requires two functions. The first is the exponential function:
(40) 
The function as function of time is the pose traveled if it is the identity pose at , and maintains a constant twist , that is
(41) 
The second is a logarithm function, which given a unit dual quaternion , finds such that . There are infinitely many possibilities for , so we will just describe the principal value, that is, the one for which the norm of the angular velocity is minimized. Then
(42)  
If one is merely interested in interpolating between the poses represented by these unit dual quaternions, multiply one of them by so that nondual part of has nonnegative real part.
The results of this section may be found in [12]. We have seen similar results in [18], but we believe our formulas to be more explicit.
Given any dual quaternion
(43) 
by decomposing into a vector parallel to and perpendicular to
, we can suppose without loss of generality that there exists orthonormal vectors
and such that is a linear combination of , , , , and .If and are orthonormal vectors, then if
(44)  
and if
(45) 
If , this represents a pose that rotates counterclockwise with angular velocity around , and translates by
(46) 
that is, the sum of a point on a line in the direction of moving with speed , and a point on a circle in the plane perpendicular to of radius which is traversed once every time units. If , this represents a pose with the identity rotation and translating in a straight line with velocity .
Suppose and are orthonormal vectors, and that
(47) 
is a unit dual quaternion (so and ), with . Let
(48) 
that is, the angle part of the polar coordinates of , with . Then if then
(49) 
where if we assume , and we set .
It is not possible to assign a canonical principal value for , because it could be for any unit vector .
9. Proofs
Proof of Equations (14) and (16).
First note that any dual number commutes with any dual quaternion. Thus
(50) 
and
(51) 
∎
Proof of Equation (27).
First, if we differentiate , we obtain , that is, is pure.
Suppose the position is the image of the constant position under the pose represented by and also represented by . Differentiating equation (2) we obtain
(52) 
Differentiating equation (19) we obtain
(53) 
After some manipulation, and setting , we obtain
(54) 
Comparing equations (52) and (54), we obtain
(55) 
and since this holds for all , the result follows. ∎
10. Projection from matrices to orthogonal matrices
What would be a good projection of matrices onto rotation matrices? One suggestion is , which works if we have
. One way to compute it is via the singular value decomposition
, when . However this is computationally expensive. See [8].References
 [1] Bruno Vilhena Adorno, Robot Kinematic Modeling and Control Based on Dual Quaternion Algebra – Part I: Fundamentals, 2017, hal01478225.
 [2] S.L. Altmann, Hamilton, Rodrigues, and the Quaternion Scandal, Mathematics Magazine, Vol. 62, No. 5. (Dec., 1989), pp. 291308.
 [3] R.S. Ball, The theory of screws: A study in the dynamics of a rigid body. Hodges, Foster and Co., Dublin, 1876.
 [4] O. Bottema, B. Roth, Theoretical Kinematics, NorthHolland, Amsterdam, 1979.
 [5] M.A. Clifford, Preliminary Sketch of Biquaternions, Proceedings of the London Mathematical Society, Volume s14, Issue 1, November 1871, Pages 381395, https://doi.org/10.1112/plms/s14.1.381.
 [6] Jaime GallardoAlvarado, Kinematic Analysis of Parallel Manipulators by Algebraic Screw Theory, Springer, Switzerland, 2016.
 [7] DaPeng Han, Qing Wei, and ZeXiang Li, Kinematic Control of Free Rigid Bodies Using Dual Quaternions, International Journal of Automation and Computing 05(3), July 2008, 319324, DOI: 10.1007/s1163300803191.
 [8] N.J. Higham, Matrix nearness problems and applications, in M.J.C. Gover and S. Barnett, editors, Applications of Matrix Theory, pages 127. Oxford University Press, 1989.
 [9] L. Kavan, S. Collins, J. Z̆ára, C. O’Sullivan, Skinning with Dual Quaternions, https://dl.acm.org/doi/pdf/10.1145/1230100.1230107.
 [10] L. Kavan, S. Collins, J. Z̆ára, C. O’Sullivan, Geometric Skinning with Approximate Dual Quaternion Blending, ACM Transactions on Graphics, Vol. 27, No. 4, Article 105, Publication date: October 2008.
 [11] Ben Kenwright, A Beginners Guide to DualQuaternions, What They Are, How They Work, and How to Use Them for 3D Character Hierarchies, https://cs.gmu.edu/~jmlien/teaching/cs451/uploads/Main/dualquaternion.pdf.
 [12] Stephen MontgomerySmith, Functional Calculus for dual quaternions, arXiv:2202.04681, https://arxiv.org/abs/2202.04681.
 [13] J. Pujol, Hamilton, Rodrigues, Gauss, Quaternions, and Rotations: a Historical Reassessment, Commun. Math. Anal., Volume 13, Number 2 (2012), 114.
 [14] Ken Shoemake, Animating Rotation with Quaternion Curves, SIGGRAPH 1985, https://www.cs.cmu.edu/~kiranb/animation/p245shoemake.pdf.

[15]
Stanford Artificial Intelligence Laboratory et al., Robotic Operating System,
https://www.ros.org, 2018.  [16] M. Schilling, Universally manipulable body models—dual quaternion representations in layered and dynamic MMCs, Auton Robot 30, 399 (2011), https://doi.org/10.1007/s1051401192263https://link.springer.com/article/10.1007/s1051401192263.

[17]
M. Schilling, Hierarchical Dual QuaternionBased Recurrent Neural Network as a Flexible Internal Body Model, 2019 International Joint Conference on Neural Networks (IJCNN), 2019, pp. 18, doi: 10.1109/IJCNN.2019.8852328,
https://ieeexplore.ieee.org/abstract/document/8852328.  [18] Xiangke Wang, Dapeng Han, Changbin Yu, and Zhiqiang Zheng, The geometric structure of unit dual quaternions with application in kinematic control, Journal of Mathematical Analysis and Applications 389(2), 2012, 13521364.
 [19] Wikipedia, Hodge star operator, https://en.wikipedia.org/wiki/Hodge_star_operator#Three_dimensions.
 [20] XiaoLong Yang, HongTao Wu, Yao Li, Bai Chen, A dual quaternion solution to the forward kinematics of a class of sixDOF parallel robots with full or reductant actuation, Mechanism and Machine Theory 107 (2017) 2736, http://dx.doi.org/10.1016/j.mechmachtheory.2016.08.003.