title: Applications of dual quaternions to 2D geometry
text: # Applications of dual quaternions to 2D geometry
  
  Planar quaternion multiplication :
  
  | $\times$ | $1$ | $i$ | $\varepsilon j$ | $\varepsilon k$ |
  | - | - | - | - | - |
  | $1$ | $1$ | $i$ | $\varepsilon j$ | $\varepsilon k$ |
  | $i$ | $i$ | $-1$ | $\varepsilon k$ | $-\varepsilon j$ |
  | $\varepsilon j$ | $\varepsilon j$ | $-\varepsilon k$ | $0$ | $0$ |
  | $\varepsilon k$ | $\varepsilon k$ | $\varepsilon j$ | $0$ | $0$ |
  
  In this article, we discuss certain applications of the dual quaternion algebra to 2D geometry. At this present time, the article is focused on a 4-dimensional subalgebra of the dual quaternions which we will call the planar quaternions.
  
  The planar quaternions make up a four-dimensional algebra over the real numbers. Their primary application is in representing rigid body motions in 2D space.
  
  Unlike multiplication of dual numbers or of complex numbers, that of planar quaternions is non-commutative.
  
  ## Definition
  
  In this article, the set of planar quaternions is denoted $\mathbb {DC}$. A general element $q$ of $\mathbb {DC}$ has the form A+Bi+Cεj+Dεk{\textstyle A+Bi+C\varepsilon j+D\varepsilon k} where $A$, $B$, $C$ and $D$ are real numbers; $\varepsilon$ is a dual number that squares to zero; and $i$, $j$, and $k$ are the standard basis elements of the quaternions.
  
  Multiplication is done in the same way as with the quaternions, but with the additional rule that ε{\textstyle \varepsilon } is nilpotent of index $2$, i.e., $ε^2=0{\textstyle$ \varepsilon ^{2}=0}, which in some circumstances makes ε{\textstyle \varepsilon } comparable to an infinitesimal number. It follows that the multiplicative inverses of planar quaternions are given by
  
  $(A+Bi+C\varepsilon j+D\varepsilon k)^{-1}={\frac {A-Bi-C\varepsilon j-D\varepsilon k}{A^{2}+B^{2}}}$
  
  The set $\{1,i,\varepsilon j,\varepsilon k\}$ forms a basis of the vector space of planar quaternions, where the scalars are real numbers.
  
  The magnitude of a planar quaternion $q$ is defined to be
  
  $|q|={\sqrt {A^{2}+B^{2}}}.$
  
  For applications in computer graphics, the number $A+Bi+C\varepsilon j+D\varepsilon k$ is commonly represented as the 4-tuple $(A,B,C,D)$.
  
  ## Matrix representation
  
  A planar quaternion $q=A+Bi+C\varepsilon j+D\varepsilon k$ has the following representation as a 2x2 complex matrix:
  
  ${\begin{pmatrix}A+Bi&C+Di\\0&A-Bi\end{pmatrix}}.$
  
  It can also be represented as a 2×2 dual number matrix:
  
  ${\begin{pmatrix}A+C\varepsilon &-B+D\varepsilon \\B+D\varepsilon &A-C\varepsilon \end{pmatrix}}.$
  
  The above two matrix representations are related to the Möbius transformations and Laguerre transformations respectively.
  
  ## Terminology
  
  The algebra discussed in this article is sometimes called the dual complex numbers. This may be a misleading name because it suggests that the algebra should take the form of either:
  
  * The dual numbers, but with complex-number entries
  * The complex numbers, but with dual-number entries
  
  An algebra meeting either description exists. And both descriptions are equivalent. (This is due to the fact that the tensor product of algebras is commutative up to isomorphism). This algebra can be denoted as $\mathbb {C} [x]/(x^{2})$ using ring quotienting. The resulting algebra has a commutative product and is not discussed any further.
  
  ## Representing rigid body motions
  
  Let
  
  $q=A+Bi+C\varepsilon j+D\varepsilon k$
  
  be a unit-length planar quaternion, i.e. we must have that
  
  $|q|={\sqrt {A^{2}+B^{2}}}=1.$
  
  The Euclidean plane can be represented by the set Π={i+xεj+yεk∣x∈R, y∈R}{\textstyle \Pi =\{i+x\varepsilon j+y\varepsilon k\mid x\in \mathbb {R} , y\in \mathbb {R} \}}.
  
  An element $v=i+x\varepsilon j+y\varepsilon k$ on $\Pi$ represents the point on the Euclidean plane with Cartesian coordinate $(x,y)$.
  
  $q$ can be made to act on $v$ by
  
  $qvq^{-1},$
  
  which maps $v$ onto some other point on $\Pi$.
  
  We have the following (multiple) polar forms for $q$:
  
  * When $B\neq 0$, the element $q$ can be written as $\cos(\theta /2)+\sin(\theta /2)(i+x\varepsilon j+y\varepsilon k),$ which denotes a rotation of angle $\theta$ around the point $(x,y)$.
  * When $B=0$, the element $q$ can be written as ${\begin{aligned}&1+i(x\varepsilon j+y\varepsilon k)\\=&1-y\varepsilon j+x\varepsilon k,\end{aligned}}$ which denotes a translation by vector ${\begin{pmatrix}x\\y\end{pmatrix}}.$
  
  ## Geometric construction
  
  A principled construction of the planar quaternions can be found by first noticing that they are a subset of the dual-quaternions.
  
  There are two geometric interpretations of the dual-quaternions, both of which can be used to derive the action of the planar quaternions on the plane:
  
  * As a way to represent rigid body motions in 3D space. The planar quaternions can then be seen to represent a subset of those rigid-body motions. This requires some familiarity with the way the dual quaternions act on Euclidean space. We will not describe this approach here as it is adequately done elsewhere.
  * The dual quaternions can be understood as an "infinitesimal thickening" of the quaternions. Recall that the quaternions can be used to represent 3D spatial rotations, while the dual numbers can be used to represent "infinitesimals". Combining those features together allows for rotations to be varied infinitesimally. Let $\Pi$ denote an infinitesimal plane lying on the unit sphere, equal to $\{i+x\varepsilon j+y\varepsilon k\mid x\in \mathbb {R} ,y\in \mathbb {R} \}$. Observe that $\Pi$ is a subset of the sphere, in spite of being flat (this is thanks to the behaviour of dual number infinitesimals). Observe then that as a subset of the dual quaternions, the planar quaternions rotate the plane $\Pi$ back onto itself. The effect this has on $v\in \Pi$ depends on the value of $q=A+Bi+C\varepsilon j+D\varepsilon k$ in $qvq^{-1}$:
     * When $B\neq 0$, the axis of rotation points towards some point $p$ on $\Pi$, so that the points on $\Pi$ experience a rotation around $p$.
     * When $B=0$, the axis of rotation points away from the plane, with the angle of rotation being infinitesimal. In this case, the points on $\Pi$ experience a translation.
  