Symmetries in Projective Geometric Algebra and Projective Geometric Algebra Done Right: Difference between pages

From Rigid Geometric Algebra
(Difference between pages)
Jump to navigation Jump to search
(Created page with "__NOTOC__ '''By Eric Lengyel'''<br /> October 19, 2020 This is a continuation of the post Projective Geometric Algebra Done Right from earlier this year. That post introduces the geometric antiproduct and the notation $$\unicode{x27D1}$$ and $$\unicode{x27C7}$$ used in this post. As before, everything in this post assumes familiarity with Chapter 4 of FGED1. I have been thinking about the geometric product and geometric antiproduct on a low-priority thread for most...")
 
No edit summary
 
Line 1: Line 1:
__NOTOC__
'''By Eric Lengyel'''<br />
'''By Eric Lengyel'''<br />
October 19, 2020
January 23, 2020


This is a continuation of the post [[Projective Geometric Algebra Done Right]] from earlier this year. That post introduces the geometric antiproduct and the notation $$\unicode{x27D1}$$ and $$\unicode{x27C7}$$ used in this post. As before, everything in this post assumes familiarity with Chapter 4 of FGED1.
In the last chapter of FGED1, I provided a practical introduction to projective Grassmann algebra. Most people working in computer graphics are familiar with four-dimensional homogeneous coordinates, and projective Grassmann algebra extends this concept to a larger algebraic structure under which the wedge and antiwedge products perform geometric manipulations of points, lines, and planes. FGED1 goes on to talk about ''geometric'' algebra as well, which augments Grassmann algebra, but the discussion is pretty much limited to quaternion operations in ordinary 3D space. The projective 4D analog of a quaternion is called a ''dual quaternion'', and I said at the bottom of page 173 that they would be covered in Volume 3 of the FGED series. However, I knew at the time that I didn’t want to present dual quaternions in the usual ways that they have always been introduced in the various papers that have popped up. I found them to be unwieldy, and I was intent on spending some time gaining a deeper understanding of them first so that I could find better ways to formulate the parts that bothered me. That time came over this past holiday break, and the results were better than I had hoped for.


I have been thinking about the geometric product and geometric antiproduct on a low-priority thread for most of 2020, and I have discovered a number of interesting properties that highlight beautiful symmetries in projective geometric algebra (PGA). This post summarizes a lot of my findings for those who’d like further insight into the pervasive duality that geometric algebra has to offer. There have been arguments that only one product is necessary in geometric algebra, but it’s my intention to demonstrate in part of this post that there exist elegant concepts that are complete only if both products are working together in harmony.
I don’t want this post to get too long, so I’m going to assume some familiarity with the material in Chapter 4 of FGED1, and I’m going to be rather brief with everything I write here. The most important things to know are how the wedge product $$\mathbf a \wedge \mathbf b$$ joins objects $$\mathbf a$$ and $$\mathbf b$$ into the higher-dimensional space that they span, how the antiwedge product $$\mathbf a \vee \mathbf b$$ calculates the lower-dimensional space where objects $$\mathbf a$$ and $$\mathbf b$$ meet, and how the geometric product extends the wedge product for vectors $$\mathbf a$$ and $$\mathbf b$$ to give $$\mathbf{ab} = \mathbf a \wedge \mathbf b + \mathbf a \cdot \mathbf b$$. A particular fact used below is that for two planes $$\mathbf f = f_x \mathbf e_{423} + f_y \mathbf e_{431} + f_z \mathbf e_{412} + f_w \mathbf e_{321}$$ and $$\mathbf g = g_x \mathbf e_{423} + g_y \mathbf e_{431} + g_z \mathbf e_{412} + g_w \mathbf e_{321}$$ in projective Grassmann algebra, the antiwedge product $$\mathbf f \vee \mathbf g$$ gives the line where $$\mathbf f$$ and $$\mathbf g$$ intersect.


=== Antiscalars ===
Recall that the quaternions constitute the even-graded elements of the 3D geometric algebra. A unit-length quaternion $$\mathbf q$$ is called a ''rotor'', and it rotates an object $$x$$ with the sandwich product $$\mathbf q x \mathbf{\tilde q}$$, where the tilde indicates the conjugate or ''reverse'' of $$\mathbf q$$, and juxtaposition represents the geometric product. The object $$x$$ can be a vector, bivector, or even another quaternion, and the appropriate transformation is made to rotate it using the axis and angle stored in $$\mathbf q$$. Importantly, a quaternion can be built out of two reflections through unit vectors $$\mathbf a$$ and $$\mathbf b$$ lying in the plane of rotation and separated by half the angle of rotation. The first reflection through $$\mathbf a$$ is given by $$\mathbf a x \mathbf a$$, and the second reflection through $$\mathbf b$$ is given by $$\mathbf b(\mathbf a x \mathbf a)\mathbf b = \mathbf{ba} x \mathbf {ab}$$. Two reflections produce a rotation that we represent by the quaternion $$\mathbf q = \mathbf{ba}$$.


I have been using the symbol $$\mathbf E_4$$ to represent the volume element of the 4D exterior algebra, also known as the unit antiscalar. $$\mathbf E_4$$ is the wedge product of all the basis vectors $$\mathbf e_1 \mathbf e_2 \mathbf e_3 \mathbf e_4$$. I have recently decided that the symbol $$\mathbf E_4$$ was inadequately conveying the fact that scalars and antiscalars are two sides of the same coin. I wanted to emphasize that they are equal and opposite within the algebra, with neither one having a place of greater importance, so after much searching and thought, I’ve come to the conclusion that the best symbol for the unit antiscalar is $${\large\unicode{x1d7d9}}$$, the number one in blackboard bold. I will use the symbol $$\mathbf 1$$, an ordinary bold number one, as the unit scalar. These two symbols balance each other nicely, and both of them will show up throughout this post.
A pair of reflections through two vectors, and thus a quaternion, can rotate something only about an axis passing through the origin, and it cannot perform any kind of translation. To incorporate translations into a product like $$\mathbf q x \mathbf{\tilde q}$$, which would also allow us to rotate about arbitrary lines, we need to move up to dual quaternions. Dual quaternions constitute the even-graded elements of the 4D geometric algebra $$\mathbb R_{3,0,1}$$. The subscripts 3,0,1 come from Clifford algebra classifications, and they mean that three of the vector basis elements square to $$+1$$, none of them square to $$‒1$$, and one of them squares to $$0$$. Calling the basis elements $$\mathbf e_1$$, $$\mathbf e_2$$, $$\mathbf e_3$$, and $$\mathbf e_4$$, we have $$\mathbf e_1^2 = \mathbf e_2^2 = \mathbf e_3^2 = 1$$ and $$\mathbf e_4^2 = 0$$. There are 8 even-graded components in a dual quaternion, and we can write them as a pair of ordinary quaternions $$\mathbf q_r + \varepsilon \mathbf q_d$$, where $$\mathbf q_r$$ is called the real part, $$\mathbf q_d$$ is called the dual part, and $$\varepsilon = \mathbf e_{1234}$$ squares to zero. Dual quaternions operate on an object $$x$$ through a kind of sandwich product similar to the one used by quaternions: $$(\mathbf q_r + \varepsilon \mathbf q_d)x(\mathbf{\tilde q}_r - \varepsilon \mathbf{\tilde q}_d)$$, where multiplication is the geometric product. When the dual part $$\mathbf q_d$$ is zero, a dual quaternion just performs the rotation represented by the real part $$\mathbf q_r$$. To get a translation by the vector $$\mathbf t$$, we construct the dual quaternion $$1 + \varepsilon (\mathbf i t_x/2 + \mathbf j t_y/2 + \mathbf k t_z/2)$$. Products of dual quaternions corresponding to rotations and translations then give us the full range of rigid motions.


=== Bulk and Weight ===
The conventional way in which publications teach you how to transform a point $$\mathbf p$$ with a dual quaternion is to first turn $$\mathbf p$$ into the dual quaternion $$1 + \varepsilon \mathbf i p_x + \varepsilon \mathbf j p_y + \varepsilon \mathbf k p_z$$, evaluate the product $$(\mathbf q_r + \varepsilon \mathbf q_d)(1 + \varepsilon \mathbf i p_x + \varepsilon \mathbf j p_y + \varepsilon \mathbf k p_z)(\mathbf{\tilde q}_r - \varepsilon \mathbf{\tilde q}_d)$$, and then pick off the coefficients of the $$\varepsilon \mathbf i$$, $$\varepsilon \mathbf j$$, and $$\varepsilon \mathbf k$$ terms to retrieve the result. This is a hack. What it’s really doing is casting $$\mathbf p$$ as a translation operator, transforming that operator with the dual quaternion, and then casting back to a point. It doesn’t extend to the richer set of geometric objects available in $$\mathbb R_{3,0,1}$$, which include vectors, bivectors, points, lines, and planes. With a dual quaternion $$\mathbf Q$$, what we really want is the ability to evaluate the product $$\mathbf Q x \mathbf{\tilde Q}$$ for any type of object $$x$$ and get a correctly transformed object of the same type as a result, just like we could do in 3D space with ordinary quaternions. In their SIGGRAPH 2019 course “Geometric Algebra for Computer Graphics”, the presenters point out that general $$\mathbf Q x \mathbf{\tilde Q}$$ transformations can be achieved by “turning the algebra on its head” and working with the so-called dual construction. In this formulation, homogeneous vectors represent planes, and homogeneous trivectors represent points, which is the opposite of what makes intuitive sense with respect to the dimensionality of those geometric objects. (Lines are still represented by homogeneous bivectors, but the parts that correspond to the direction and moment are reversed.) I think that requiring that things be done this way is a giant kludge that misses an important part of the big picture, and I find it disagreeable due to some of the problems that it causes. I’ll get back to those below.


A homogeneous point is represented by the vector $$\mathbf p = p_x \mathbf e_1 + p_y \mathbf e_2 + p_z \mathbf e_3 + p_w \mathbf e_4$$. The $$w$$ coordinate is sometimes called the ''weight'' of the point, and the point is projected into 3D space by scaling so that the $$w$$ coordinate is one. For a line given by $$\boldsymbol l = v_x \mathbf e_{41} + v_y \mathbf e_{42} + v_z \mathbf e_{43} + m_x \mathbf e_{23} + m_y \mathbf e_{31} + m_z \mathbf e_{12}$$, the weight is the magnitude of the direction vector $$(v_x, v_y, v_z)$$, and the line is projected into 3D space by scaling so that this magnitude is one. For a plane given by $$\mathbf g = g_x \mathbf e_{423} + g_y \mathbf e_{431} + g_z \mathbf e_{412} + g_w \mathbf e_{321}$$, the weight is the magnitude of the normal vector $$(g_x, g_y, g_z)$$, and the plane is projected into 3D space by scaling so that this magnitude is one. We use the term ''unitization'' to refer to the projection operation that causes the weight of any object to have magnitude one.
The key to using dual quaternions in the proper way without having to resort to any hacks or dimensional reversals is found in the formula $$\mathbf f \vee \mathbf g$$ producing the line where the planes $$\mathbf f$$ and $$\mathbf g$$ intersect. Any rotation about an arbitrary line in 3D space can be decomposed into a pair of reflections through planes that intersect at that line, and the angle of rotation is twice the angle at which the planes meet. In order to capture information about the angle in an operator, we must use a geometric product and not just an exterior product. The problem is that the geometric product incorporates the wedge product $$\wedge$$ whereas the meet of two planes is derived from the antiwedge product $$\vee$$. The geometric product works fine for ordinary quaternions where two reflections through vectors $$\mathbf a$$ and $$\mathbf b$$ produce a rotation in the bivector $$\mathbf a \wedge \mathbf b$$, but it’s not the correct product where two reflections through planes $$\mathbf f$$ and $$\mathbf g$$ produce a rotation about the line $$\mathbf f \vee \mathbf g$$. Instead, we need the geometric analog of the antiwedge product. The existence of such a product follows from the fundamental property that everything in geometric algebra has a complement. (There is an automorphism on every geometric algebra in which elements and operations are mapped to their complements, and it produces the same structure.) The geometric antiproduct that we need complements the geometric product in the same way that the exterior antiproduct (the antiwedge product) complements the exterior product (the wedge product).


In general, the components of an object in the algebra can be separated into those that include the basis vector $$\mathbf e_4$$ and those that do not. The parts that do include $$\mathbf e_4$$ represent the extent of the object into the fourth dimension, and these components are collectively called the ''weight'' of the object. An object is projected into 3D space by normalizing its weight to unit magnitude, and I will have much more to say about this when I discuss norms below. The remaining parts of an object, those that do not include the basis vector $$\mathbf e_4$$, are collectively called the ''bulk'' of the object.
I have searched the literature for any mention of multiplication resembling the geometric antiproduct, but I have come up completely empty. As far as I know, it has never been introduced, and there is no notation for it. Unfortunately, because the geometric product is denoted by juxtaposition, we don’t have an infix operator that we can simply flip upside down like we could with the wedge and antiwedge products. I propose that we use the symbols $$\unicode{x27D1}$$ and $$\unicode{x27C7}$$ to denote the geometric product and geometric antiproduct, respectively, at least in contexts where a distinction is necessary. These symbols fittingly incorporate the fact that the geometric product between vectors combines their wedge product and dot product, and that the geometric antiproduct between antivectors combines their antiwedge product and antidot product. (The antidot product works with antivectors in the same way that the dot product works with vectors, but it produces an antiscalar quantity instead of a scalar quantity.)


I will use a solid circle as a subscript to represent the bulk of an object, and I will use an empty circle as a subscript to represent the weight. Then the notation $$\mathbf a_\unicode{x25CF}$$ means the sum of the components of $$\mathbf a$$ that exclude the basis vector $$\mathbf e_4$$, and the notation $$\mathbf a_\unicode{x25CB}$$ means the sum of the components of $$\mathbf a$$ that include the basis vector $$\mathbf e_4$$. We will never have a need to use these directly in a calculation, but their complements actually arise in an interesting way when we perform projections, as discussed below.
The correct way to construct a dual quaternion $$\mathbf Q$$ from a pair of reflections through the planes $$\mathbf f$$ and $$\mathbf g$$ is by calculating $$\mathbf Q = \mathbf f \mathbin{\unicode{x27C7}} \mathbf g$$. This calculates the line $$\mathbf f \vee \mathbf g$$ and adds the value $$(f_xg_x + f_yg_y + f_zg_z)\mathbf e_{1234}$$ to it. If the planes $$\mathbf f$$ and $$\mathbf g$$ are normalized, then that additional antidot product is the cosine of the angle between the normal directions, which is half the angle of rotation. If $$\mathbf f$$ and $$\mathbf g$$ are parallel, then $$\mathbf Q$$ represents a translation along the normal direction by twice the distance separating the planes. In general, a unit-length dual quaternion $$\mathbf R$$ having the form


I’ve always considered it to be somewhat artificial whenever we have to pick off components of some value in order to create another quantity. It generally indicates that something has been overcalculated, and a simpler or more natural operation can be used instead. I was pleasantly surprised to discover that the complements of the bulk and weight can be directly calculated in the algebra with the following formulas:
:$$\mathbf R = (a_x \mathbf e_{41} + a_y \mathbf e_{42} + a_z \mathbf e_{43}) \sin(\phi/2) + \mathbf e_{1234} \cos(\phi/2)$$


{|
is a pure rotation through the angle $$\phi$$ about the axis $$(a_x, a_y, a_z)$$. A dual quaternion $$\mathbf T$$ having the form
| style="padding-left: 1em; padding-right: 5em;" | $$\overline{\mathbf a_\smash{\unicode{x25CF}}} = \mathbf{\tilde a} \mathbin{\unicode{x27D1}} {\large\unicode{x1D7D9}}$$
| (bulk right complement)
|-
| style="padding-left: 1em; padding-right: 5em;" | $$\overline{\mathbf a_\smash{\unicode{x25CB}}} = \mathbf 1 \mathbin{\unicode{x27C7}} \mathbf{\tilde a}$$
| (weight right complement)
|-
| style="padding-left: 1em; padding-right: 5em;" | $$\underline{\mathbf a_\smash{\unicode{x25CF}}} = \smash{\mathbf{\underset{\Large\unicode{x7E}}{a}}} \mathbin{\unicode{x27D1}} {\large\unicode{x1D7D9}}$$
| (bulk left complement)
|-
| style="padding-left: 1em; padding-right: 5em;" | $$\underline{\mathbf a_\smash{\unicode{x25CB}}} = \mathbf 1 \mathbin{\unicode{x27C7}} \smash{\mathbf{\underset{\Large\unicode{x7E}}{a}}}$$
| (weight left complement)
|}


These equations possess an elegant symmetry that relates the reverse and antireverse to the right and left complements and makes use of both the geometric product and geometric antiproduct with the multiplicative identity of the other product.
:$$\mathbf T = (t_x/2)\mathbf e_{23} + (t_y/2)\mathbf e_{31} + (t_z/2)\mathbf e_{12} + \mathbf e_{1234}$$


Since the bulk and weight are disjoint, so are their complements, and we can add them to obtain full complements:
is a pure translation by the vector $$\mathbf t$$. Combinations of these types of dual quaternions under the geometric antiproduct can be used to construct all rigid motions in three dimensions. Any object $$x$$, whether it be a point, line, plane, or any other member of $$\mathbb R_{3,0,1}$$, is transformed by a dual quaternion $$\mathbf Q$$ using the same sandwich product $$\mathbf Q \mathbin{\unicode{x27C7}} x \mathbin{\unicode{x27C7}} \smash{\mathbf{\underset{\Large\unicode{x7E}}{Q}}}$$. Here, the squiggle has been moved to the bottom to indicate that we are using the complement of the reverse operation, which we could call the ''antireverse''. For dual quaternions, whether we use the reverse or antireverse doesn’t matter because they have the same effect on even-graded elements. But for other operators, such as a reflection through a single plane, or in geometric algebras for spaces of other dimensionality, it can make a difference in sign.


{|
I’ve whipped up a poster-sized reference guide for projective geometric algebra in $$\mathbb R_{3,0,1}$$. It provides a lot of the details for geometric calculations in 4D Grassmann algebra, it contains the complete multiplication tables for both the geometric product and geometric antiproduct, and it shows explicit formulas for performing transformations with dual quaternions. (This reference guide has been doubled in size to include information from the next post, [[Symmetries in Projective Geometric Algebra]].)
| style="padding-left: 1em; padding-right: 5em;" | $$\overline{\mathbf a} = \mathbf{\tilde a} \mathbin{\unicode{x27D1}} {\large\unicode{x1D7D9}} + \mathbf 1 \mathbin{\unicode{x27C7}} \mathbf{\tilde a}$$
| (right complement)
|-
| style="padding-left: 1em; padding-right: 5em;" | $$\underline{\mathbf a} = \smash{\mathbf{\underset{\Large\unicode{x7E}}{a}}} \mathbin{\unicode{x27D1}} {\large\unicode{x1D7D9}} + \mathbf 1 \mathbin{\unicode{x27C7}} \smash{\mathbf{\underset{\Large\unicode{x7E}}{a}}}$$
| (left complement)
|}


What this really means is that the combination of both the product and antiproduct allows us to calculate a complete dual of any element using only the multiplication and reversion operations of the algebra. This task is impossible in a degenerate algebra when only the geometric product is recognized because it always annihilates components containing $$\mathbf e_4$$. The geometric antiproduct is required in order to fill in the other half.
The authors of the SIGGRAPH course I mentioned earlier claimed that their dual construction was the only way to implement plane-based projective geometric algebra, but that is not true. Their failure to recognize the existence of the geometric antiproduct forced them to do many things backwards, and the result was an unnecessarily convoluted geometric model that resists intuition. While they’ve managed to make things work from a purely computational perspective, I perceive the quirks in their model as essentially aberrations derived from an incomplete picture of the mathematics. The following list summarizes the main problems that arise.


The bulk of an object stores information about its position, encoding the object’s location relative to the origin. The weight of an object stores information about its [[attitude]], encoding the spatial direction that the object faces. The weight is particularly useful in projection calculations because its complement provides directional information in a form that can be conveniently joined with the geometry being projected.
* Their model requires that points be represented by trivectors and planes be represented by vectors. This is backwards. In 4D projective space, points are one-dimensional, and planes are three-dimensional. The projection into 3D space removes a dimension and naturally make points zero-dimensional and planes two-dimensional, but that’s not what they have. Furthermore, swapping points and planes has serious implications for nonorthogonal change-of-basis transformations, which happen in computer graphics all the time, but they completely ignore this issue.


=== Norms ===
* Because points and planes are backwards, the geometric meaning of the wedge and antiwedge products are also necessarily backwards. Their model requires that $$\wedge$$ corresponds to a dimension-decreasing meet operation and $$\vee$$ corresponds to a dimension-increasing join operation, but in the Grassmann algebra used by the rest of the world, the meanings are the other way around.


In many algebras, the Euclidean norm of some element $$\mathbf a$$ is routinely calculated using the formula $$\left\Vert \mathbf a \right\Vert = (\mathbf a \cdot \mathbf a^*)^{1/2}$$, where $$\cdot$$ is the multiplication in the algebra and $$*$$ represents some kind of conjugate operation. In the geometric algebra, this becomes $$\left\Vert \mathbf a \right\Vert = (\mathbf a \mathbin{\unicode{x27D1}} \mathbf{\tilde a})^{1/2}$$. Because $$\mathbf e_4^2 = 0$$, this formula ends up calculating the magnitude of only the bulk part of $$\mathbf a$$. However, when we recognize that geometric algebra has two products, we can also calculate a different norm using the formula $$\left\Vert \mathbf a \right\Vert = (\mathbf a \mathbin{\unicode{x27C7}} \smash{\mathbf{\underset{\Large\unicode{x7E}}{a}}})^{1/2}$$, where we are taking the square root with respect to the antiproduct. Whereas the product $$\mathbf a \mathbin{\unicode{x27D1}} \mathbf{\tilde a}$$ results in a scalar quantity, the antiproduct $$\mathbf a \mathbin{\unicode{x27C7}} \smash{\mathbf{\underset{\Large\unicode{x7E}}{a}}}$$ results in an antiscalar quantity. (The square root of an antiscalar simply follows the identity $$(x {\large\unicode{x1D7D9}})^{1/2} = x^{1/2}{\large\unicode{x1D7D9}}$$.) This second norm calculates the magnitude of the weight part of $$\mathbf a$$, demonstrating another way in which the product and antiproduct work together to form a whole. The two norms are summarized as follows:
* Their concept of normalization is backwards. The projective dimension is represented by the basis element $$\mathbf e_4$$, and this means that an object in the projective algebra is normalized when the part that extends into this fourth dimension has a magnitude of one. For example, a homogeneous point is normalized when its $$\mathbf e_4$$ coordinate is one, a line is normalized when its $$(\mathbf e_{41}, \mathbf e_{42}, \mathbf e_{43})$$ direction has length one, and a plane is normalized when its $$(\mathbf e_{423}, \mathbf e_{431}, \mathbf e_{412})$$ normal has length one. This also applies to a dual quaternion, which is normalized when its $$(\mathbf e_{41}, \mathbf e_{42}, \mathbf e_{43}, \mathbf e_{1234})$$ rotor part has length one. In general, the magnitude of the collection of components involving the projective basis element $$\mathbf e_4$$ has to be one. However, in the dual construction model, its the components that don’t involve $$\mathbf e_4$$ that must have a magnitude of one.


{|
This awkwardness is instantly cleaned up by using the product that naturally performs reflection through planes, the geometric antiproduct $$\unicode{x27C7}$$. Points and planes still have the right dimensionality, the wedge product still calculates the join, the antiwedge product still calculates the meet, and normalization always involves only the projective dimension. Nothing has to be flipped upside down or turned inside out, and nonorthogonal change-of-basis transformations have the correct effect on the geometry associated with elements of every grade. The lack of problems in the model produced by the geometric antiproduct and its natural elegance make it clear to me that it is the right way to go.
| style="padding-left: 1em; padding-right: 5em;" | $$\left\Vert \mathbf a \right\Vert_\smash{\unicode{x25CF}} = (\mathbf a \mathbin{\unicode{x27D1}} \mathbf{\tilde a})^{1/2}$$
| (bulk norm)
|-
| style="padding-left: 1em; padding-right: 5em;" | $$\left\Vert \mathbf a \right\Vert_\smash{\unicode{x25CB}} = (\mathbf a \mathbin{\unicode{x27C7}} \smash{\mathbf{\underset{\Large\unicode{x7E}}{a}}})^{1/2}$$
| (weight norm)
|}


I’m introducing a new definition for the norm of an element $$\mathbf a$$, with no qualifier, to be the sum of the bulk norm and the weight norm:
Keep in mind that the description above is extremely abbreviated, and there is a lot more that can be said about using dual quaternions to perform rigid motions. There are a lot of computational details on the reference poster, which is also available as a [https://www.amazon.com/dp/B09F8PN65Y/?tag=terathon-20 18×24 inch print on Amazon]. I will be dedicating an entire chapter to this subject in FGED3, where I will also cover its application to skinning.
 
{|
| style="padding-left: 1em; padding-right: 5em;" | $$\left\Vert \mathbf a \right\Vert_ = \left\Vert \mathbf a \right\Vert_\smash{\unicode{x25CF}} + \left\Vert \mathbf a \right\Vert_\smash{\unicode{x25CB}} = (\mathbf a \mathbin{\unicode{x27D1}} \mathbf{\tilde a})^{1/2} + (\mathbf a \mathbin{\unicode{x27C7}} \smash{\mathbf{\underset{\Large\unicode{x7E}}{a}}})^{1/2}$$
| (total geometric norm)
|}
 
Unlike conventional norms, this norm is a two-component homogeneous magnitude consisting of a pair of numbers, a scalar and an antiscalar, which we could write as $$x \mathbf 1 + y {\large\unicode{x1d7d9}}$$. As with all things homogeneous, we project into 3D space by requiring the weight part ($$y$$ in this case) to have unit magnitude. Unitizing the norm by taking the quotient of the bulk part and the weight part (technically, division with respect to the antiproduct) produces a concrete Euclidean distance measure. In the case of a point, the unitized norm is the distance from the point to the origin. In the case of a line, the unitized norm is the perpendicular distance from the line to the origin. In the case of a plane, the unitized norm is the perpendicular distance from the plane to the origin.
 
We can also talk about the norm of a motion operator (motor) $$\mathbf Q = r_x \mathbf e_{41} + r_y \mathbf e_{42} + r_z \mathbf e_{43} + r_w {\large\unicode{x1d7d9}} + u_x \mathbf e_{23} + u_y \mathbf e_{31} + u_z \mathbf e_{12} + u_w$$. The bulk norm of $$\mathbf Q$$ is given by $$\left\Vert \mathbf Q \right\Vert_\smash{\unicode{x25CF}} = (u_x^2 + u_y^2 + u_z^2 + u_w^2)^{1/2}$$, and although it isn’t even remotely obvious, this is equal to exactly half of the weight-scaled distance that a point at the origin is moved by the motor $$\mathbf Q$$, accounting for both rotation in the plane perpendicular to the axis and translation along the axis. I will show one way to arrive at this fact below.
 
The weight norm of $$\mathbf Q$$ is the magnitude of the four components making up the rotational part of the dual quaternion. As with everything else, it’s these components that include a factor of $$\mathbf e_4$$ that we want to unitize in order to project into 3D space. This nicely consistent rule means that purely rotational motors are the unit quaternions that we would expect.
 
=== Projections ===
 
When all we have to worry about is vectors, the formula $$(\mathbf a \cdot \mathbf{\hat b})\mathbf{\hat b}$$ is not too hard to understand as the projection of the vector $$\mathbf a$$ onto the vector $$\mathbf b$$, where the notation $$\mathbf{\hat b}$$ means that $$\mathbf b$$ has been normalized. It is possible to generalize this formula in geometric algebra for the projection of points, lines, and planes onto other points, lines, and planes, but I find it difficult to form an intuitive understanding of what’s happening when we take the dot product between a point and a line, for example, and then multiply the result by the line again using one of the geometric products. Fortunately, projections can be broken down into simpler operations that make a lot of sense when you understand that a wedge product performs a join operation, and an antiwedge product performs a meet operation.
 
I’m first going to introduce the interior products because they allow me to express projections in an interesting form, but keep in mind that you ultimately will not need to use them directly if you don’t want to. The right and left interior products are defined as follows:
 
{|
| style="padding-left: 1em; padding-right: 5em;" | $$\mathbf a \mathbin{\unicode{x22A2}} \mathbf b = \mathbf a \vee \overline{\mathbf b}$$
| (right interior product)
|-
| style="padding-left: 1em; padding-right: 5em;" | $$\mathbf a \mathbin{\unicode{x22A3}} \mathbf b = \underline{\mathbf a} \vee \mathbf b$$
| (left interior product)
|}
 
Up to sign, these produce the same results as what some authors call the right and left contraction products, and both types of products can be used as the basis for defining a dot product. In previous works by other authors, the left interior product has been defined using $$\overline{\mathbf b}$$ instead of $$\underline{\mathbf a}$$, but this introduces an asymmetry that causes some problems. Using the above definitions, $$\mathbf a \mathbin{\unicode{x22A2}} \mathbf a = \mathbf a \mathbin{\unicode{x22A3}} \mathbf a = +1$$ for all basis elements $$\mathbf a$$ of all grades, and the following relationship holds independently of the number of dimensions:
 
:$$\mathbf a \mathbin{\unicode{x22A3}} \mathbf b = (−1)^{gr(a)(gr(a) + gr(b))} \mathbf b \mathbin{\unicode{x22A3}} \mathbf a$$
 
Using the interior products, the general projection of a blade $$\mathbf a$$ onto a blade $$\mathbf b$$ is given by this peculiar-looking formula:
 
{|
| style="padding-left: 1em; padding-right: 5em;" | $$\mathbf{\hat b} \mathbin{\unicode{x22A2}} \mathbf a \mathbin{\unicode{x22A3}} \mathbf{\hat b}$$
| (projection of $$\mathbf a$$ onto $$\mathbf b$$)
|}
 
This expression is associative in the sense that it doesn’t matter if we calculate $$(\mathbf{\hat b} \mathbin{\unicode{x22A2}} \mathbf a) \mathbin{\unicode{x22A3}} \mathbf{\hat b}$$ or $$\mathbf{\hat b} \mathbin{\unicode{x22A2}} (\mathbf a \mathbin{\unicode{x22A3}} \mathbf{\hat b})$$ because they both give the same answer. This formula for the projection is non-metric and thus cannot handle positional information. In order to project our points, lines, and planes onto one another, we need to make a small tweak that implicitly accounts for the fact that $$\mathbf e_4^2 = 0$$. This is done by taking only the weight part of $$\mathbf b$$ in one of the interior products (and it doesn’t matter which one) as follows:
 
{|
| style="padding-left: 1em; padding-right: 5em;" | $$(\mathbf b_\smash{\unicode{x25CB}} \mathbin{\unicode{x22A2}} \mathbf a) \mathbin{\unicode{x22A3}} \mathbf b$$ or $$\mathbf b \mathbin{\unicode{x22A2}} (\mathbf a \mathbin{\unicode{x22A3}} \mathbf b_\smash{\unicode{x25CB}})$$
| (geometric projection of $$\mathbf a$$ onto $$\mathbf b$$)
|}
 
Now, we need to parenthesize so that the product with b○ is done first. Since the projective algebra is homogeneous, that hats on $$\mathbf b$$ have also been dropped. When we expand the first of these expressions using the definitions of the right and left interior products, we get this:
 
{|
| style="padding-left: 1em; padding-right: 5em;" | $$(\underline{\mathbf b_\smash{\unicode{x25CB}}} \wedge \mathbf a) \vee \mathbf b$$
| (geometric projection of $$\mathbf a$$ onto $$\mathbf b$$)
|}
 
In this form, we can derive some geometric intuition about what’s going on. As mentioned above, the expression $$(\underline{\mathbf b_\smash{\unicode{x25CB}}}$$ extracts the attitude of the object $$\mathbf b$$ in a perpendicular form while throwing away information about the position. The wedge product joins things together, so the expression $$\underline{\mathbf b_\smash{\unicode{x25CB}}} \wedge \mathbf a$$ means “create an object perpendicular to $$\mathbf b$$ that contains $$\mathbf a$$.” Taking the antiwedge product of this object with the original $$\mathbf b$$ then performs a meet operation that projects a perpendicularly onto $$\mathbf b$$.
 
In the case that we are projecting a point $$\mathbf p$$ onto a plane $$\mathbf g$$, the weight complement $$(\underline{\mathbf g_\smash{\unicode{x25CB}}}$$ gives us the vector $$g_x \mathbf e_1 + g_y \mathbf e_2 + g_z \mathbf e_3$$ corresponding to the plane’s normal direction. The wedge product $$\underline{\mathbf g_\smash{\unicode{x25CB}}} \wedge \mathbf p$$ then creates a line passing through $$\mathbf p$$ and perpendicular to the plane. Taking the antiwedge product between this line and the plane calculates the meet, essentially moving $$\mathbf p$$ along the perpendicular line until it hits the plane.
 
The case in which we are projecting a point $$\mathbf p$$ onto a line $$\boldsymbol l$$ is similar. The weight complement $$(\underline{\boldsymbol l_\smash{\unicode{x25CB}}}$$ gives us the line at infinity $$v_x \mathbf e_{23} + v_y \mathbf e_{31} + v_z \mathbf e_{12}$$ corresponding to all the points at infinity in directions perpendicular to the direction of the original line $$\boldsymbol l$$. The wedge product $$\underline{\boldsymbol l_\smash{\unicode{x25CB}}} \wedge \mathbf p$$ then creates a plane containing $$\mathbf p$$ that is also perpendicular to the original line. Taking the antiwedge product between this plane and the original line calculates the meet, essentially moving $$\mathbf p$$ in the perpendicular plane until it hits the line.
 
The above projection formulas work when we are projecting an object of lower dimensionality onto an object of equal or higher dimensionality. (When you project onto something of equal dimensionality, you always end up with a scaled version of the point, line, or plane that you’re projecting onto.) Although it takes a little getting used to, we can also go the other way and ''antiproject'' an object of higher dimensionality onto an object of lower dimensionality. It sounds a bit weird to say you’re going to do something like project a plane onto a point, but all it really does is move the plane in its normal direction so that it contains the point. This happens in the opposite sense that projecting a point onto a plane moves the point in the normal direction so that it lies in the plane.
 
The formula for an antiprojection is the same as the formula for a projection, except the interior products are replaced by interior antiproducts. We don’t really need to bother getting into a silly exposition of interior antiproducts because what ends up happening is that the wedge and antiwedge products are simply exchanged as follows:
 
{|
| style="padding-left: 1em; padding-right: 5em;" | $$(\underline{\mathbf b_\smash{\unicode{x25CB}}} \vee \mathbf a) \wedge \mathbf b$$
| (geometric antiprojection of $$\mathbf a$$ onto $$\mathbf b$$)
|}
 
This formula projects planes onto lines, planes onto points, and lines onto points.
 
=== Motors ===
 
Now for a few notes about the exponential form of a motor $$\mathbf Q$$ under the geometric antiproduct $$\unicode{x27C7}$$. Suppose that we have a unitized line $$\boldsymbol l$$ and we want to construct the motor that performs a rotation about $$\boldsymbol l$$ through an angle $$2\phi$$ followed by a translation along $$\boldsymbol l$$ by a distance $$2d$$. Such a motor is given by the exponential of $$(d + \phi{\large\unicode{x1d7d9}}) \mathbin{\unicode{x27C7}} \boldsymbol l$$ with respect to the geometric antiproduct, which expands to the following:
 
:$$\mathbf Q = \exp_{\unicode{x27C7}}(d + \phi{\large\unicode{x1d7d9}}) \mathbin{\unicode{x27C7}} \boldsymbol l = \cos_{\unicode{x27C7}}(d + \phi{\large\unicode{x1d7d9}}) + \sin_{\unicode{x27C7}}(d + \phi{\large\unicode{x1d7d9}}) \mathbin{\unicode{x27C7}} \boldsymbol l$$
 
The subscript $$\unicode{x27C7}$$ on the exponential, cosine, and sine functions means that the multiplication on which these are based is the antiproduct. If you’d like to work things out with power series, keep in mind that $$x^0 = {\large\unicode{x1d7d9}}$$ under the antiproduct $$\unicode{x27C7}$$, not 1 as it would be under the product $$\unicode{x27D1}$$. We can expand this formula further so it becomes an expression involving ordinary sines and cosines of the angle $$\phi$$ as follows:
 
:$$Q = \exp_{\unicode{x27C7}}(d + \phi{\large\unicode{x1d7d9}}) \mathbin{\unicode{x27C7}} \boldsymbol l = {\large\unicode{x1d7d9}} \cos \phi − d \sin \phi + (d \mathbin{\unicode{x27C7}} \boldsymbol l) \cos \phi + \boldsymbol l \sin \phi$$
 
When we take the weight norm of the right side of this equation, we always get $$\left\Vert \mathbf Q \right\Vert_\smash{\unicode{x25CB}} = {\large\unicode{x1d7d9}}$$, which is nice because it means that the motor is always unitized. (Remember that the direction part of $$\boldsymbol l$$ has been assumed to be unit length.) When we take the bulk norm, we get the following:
 
:$$\left\Vert \mathbf Q \right\Vert_\smash{\unicode{x25CF}} = (d^2 + (m_x^2 + m_y^2 + m_z^2) \sin^2 \phi)^{1/2}$$
 
The $$d^2$$ appearing in this equation clearly corresponds to half the distance moved along the line $$\boldsymbol l$$. For a unitized line, the square of the moment appearing in the equation is the squared perpendicular distance from the line to the origin, but it’s rather oddly multiplied by $$\sin^2 \phi$$ without any accompanying cosine in sight. Making sense out of this requires a little trig fu:
 
:$$\sin^2 \phi = \dfrac{1}{2}(1 − \cos 2\phi)$$
 
:$$= \dfrac{1}{4}(2 − 2 \cos 2\phi)$$
 
:$$= \dfrac{1}{4}(\sin^2 2\phi + \cos^2 2\phi + 1 − 2 \cos 2\phi)$$
 
:$$= \dfrac{1}{4}[\sin^2 2\phi + (1 − \cos 2\phi)^2]$$
 
This last line is the square of precisely half the distance that a point one unit away from the line would move in the plane perpendicular to the line under the rotation through the angle $$2\phi$$ performed by the motor $$\mathbf Q$$. Multiplying this by the square of the line’s moment tells us how far any point the same distance from the line as the origin moves in the perpendicular plane. Adding the $$d^2$$ to account for the motion parallel to the line, we conclude that the norm of a motor is equal to exactly half the distance that the origin is moved when we apply the motor $$\mathbf Q$$ to it.
 
=== Conclusion ===
 
Symmetries abound in PGA, and they should be embraced whenever possible. Mathematically, a model in which vectors are planes and we only use the geometric product is absolutely identical to a model in which vectors are points and we only use the geometric antiproduct. Any claim that one of these models is somehow more natural or better in any way from a mathematical perspective of any kind is categorically wrong. That said, it is still valid to argue about which model departs from established conventions the most and whether both the geometric product and geometric antiproduct should be recognized within the algebra. My opinion is that the model in which vectors are points not only sticks to established conventions to a much greater degree but is also more intuitive. Based on what I’ve written above, it should be clear that I think a complete understanding and clean implementation of PGA requires us to welcome both the geometric product and geometric antiproduct and take advantage of the symmetries they provide.
 
The following table compares a variety of the properties of the two models to help you form your own opinion.
 
{| class="wikitable"
! Direct homogeneous model<br />Vectors are points<br />Both the products $$\unicode{x27D1}$$ and $$\unicode{x27C7}$$ are available !! Dual homogeneous model<br />Vectors are planes<br />Only the geometric product $$\unicode{x27D1}$$ is available
|-
| The grade of a projective $$k$$-dimensional object is $$k + 1$$.
| The grade of a projective $$k$$-dimensional object is $$3 − k$$.
|-
| A point $$\mathbf p$$ is a vector $$p_x \mathbf e_1 + p_y \mathbf e_2 + p_z \mathbf e_3 + p_w \mathbf e_4$$.
| A point $$\mathbf p$$ is a trivector $$p_x \mathbf e_{423} + p_y \mathbf e_{431} + p_z \mathbf e_{412} + p_w \mathbf e_{321}$$.
|-
| A direction $$\mathbf v$$ is a vector $$v_x \mathbf e_1 + v_y \mathbf e_2 + v_z \mathbf e_3$$.
| A direction $$\mathbf v$$ is a trivector $$v_x e_{423} + v_y \mathbf e_{431} + v_z \mathbf e_{412}$$.
|-
| A plane $$\mathbf g$$ is a trivector $$g_x \mathbf e_{423} + g_y \mathbf e_{431} + g_z \mathbf e_{412} + g_w \mathbf e_{321}$$.
| A plane $$\mathbf g$$ is a vector $$g_x \mathbf e_1 + g_y \mathbf e_2 + g_z \mathbf e_3 + g_w \mathbf e_4$$.
|-
| The wedge product $$\wedge$$ performs the join operation.
| The wedge product $$\wedge$$ performs the meet operation.
|-
| The antiwedge product $$\vee$$ performs the meet operation.
| The antiwedge product $$\vee$$ performs the join operation.
|-
| The weight of an object is the magnitude of the components that include the projective basis element $$\mathbf e_4$$.
| The weight of an object is the magnitude of the components that do not include the projective basis element $$\mathbf e_4$$.
|-
| Norms with respect to the geometric product $$\unicode{x27D1}$$ correspond to Euclidean distances for points, lines, planes, and motors.
| Norms with respect to the geometric product $$\unicode{x27D1}$$ correspond to weights.
|-
| Norms with respect to the geometric antiproduct $$\unicode{x27C7}$$ correspond to weights.
| The geometric antiproduct is not available, but there is something called an infinity-norm that can only be defined implicitly. It is able to produce Euclidean distances.
|-
| The dot product between two directions $$\mathbf v$$ and $$\mathbf w$$ satisfies the formula $$\mathbf v \cdot \mathbf w = \left\Vert\mathbf v\right\Vert \left\Vert\mathbf w\right\Vert \cos \phi$$.
| The dot product between two directions $$\mathbf v$$ and $$\mathbf w$$ is always zero. Recovering the conventional dot product formula requires an antidot product, which is not available in this model. If it were available, it would produce an antiscalar.
|-
| The dual of an element $$\mathbf a$$ is given by $$\mathbf{\tilde a} \mathbin{\unicode{x27D1}} {\large\unicode{x1D7D9}} + \mathbf 1 \mathbin{\unicode{x27C7}} \mathbf{\tilde a}$$, and the inverse dual is given by $$\smash{\mathbf{\underset{\Large\unicode{x7E}}{a}}} \mathbin{\unicode{x27D1}} {\large\unicode{x1D7D9}} + \mathbf 1 \mathbin{\unicode{x27C7}} \smash{\mathbf{\underset{\Large\unicode{x7E}}{a}}}$$ (or vice-versa).
| There are no explicit formulas for the dual or inverse dual because both the geometric product and geometric antiproduct are required.
|}


== See Also ==
== See Also ==


* [[Projective Geometric Algebra Done Right]]
* [[Symmetries in Projective Geometric Algebra]]

Revision as of 01:46, 5 August 2023

By Eric Lengyel
January 23, 2020

In the last chapter of FGED1, I provided a practical introduction to projective Grassmann algebra. Most people working in computer graphics are familiar with four-dimensional homogeneous coordinates, and projective Grassmann algebra extends this concept to a larger algebraic structure under which the wedge and antiwedge products perform geometric manipulations of points, lines, and planes. FGED1 goes on to talk about geometric algebra as well, which augments Grassmann algebra, but the discussion is pretty much limited to quaternion operations in ordinary 3D space. The projective 4D analog of a quaternion is called a dual quaternion, and I said at the bottom of page 173 that they would be covered in Volume 3 of the FGED series. However, I knew at the time that I didn’t want to present dual quaternions in the usual ways that they have always been introduced in the various papers that have popped up. I found them to be unwieldy, and I was intent on spending some time gaining a deeper understanding of them first so that I could find better ways to formulate the parts that bothered me. That time came over this past holiday break, and the results were better than I had hoped for.

I don’t want this post to get too long, so I’m going to assume some familiarity with the material in Chapter 4 of FGED1, and I’m going to be rather brief with everything I write here. The most important things to know are how the wedge product $$\mathbf a \wedge \mathbf b$$ joins objects $$\mathbf a$$ and $$\mathbf b$$ into the higher-dimensional space that they span, how the antiwedge product $$\mathbf a \vee \mathbf b$$ calculates the lower-dimensional space where objects $$\mathbf a$$ and $$\mathbf b$$ meet, and how the geometric product extends the wedge product for vectors $$\mathbf a$$ and $$\mathbf b$$ to give $$\mathbf{ab} = \mathbf a \wedge \mathbf b + \mathbf a \cdot \mathbf b$$. A particular fact used below is that for two planes $$\mathbf f = f_x \mathbf e_{423} + f_y \mathbf e_{431} + f_z \mathbf e_{412} + f_w \mathbf e_{321}$$ and $$\mathbf g = g_x \mathbf e_{423} + g_y \mathbf e_{431} + g_z \mathbf e_{412} + g_w \mathbf e_{321}$$ in projective Grassmann algebra, the antiwedge product $$\mathbf f \vee \mathbf g$$ gives the line where $$\mathbf f$$ and $$\mathbf g$$ intersect.

Recall that the quaternions constitute the even-graded elements of the 3D geometric algebra. A unit-length quaternion $$\mathbf q$$ is called a rotor, and it rotates an object $$x$$ with the sandwich product $$\mathbf q x \mathbf{\tilde q}$$, where the tilde indicates the conjugate or reverse of $$\mathbf q$$, and juxtaposition represents the geometric product. The object $$x$$ can be a vector, bivector, or even another quaternion, and the appropriate transformation is made to rotate it using the axis and angle stored in $$\mathbf q$$. Importantly, a quaternion can be built out of two reflections through unit vectors $$\mathbf a$$ and $$\mathbf b$$ lying in the plane of rotation and separated by half the angle of rotation. The first reflection through $$\mathbf a$$ is given by $$\mathbf a x \mathbf a$$, and the second reflection through $$\mathbf b$$ is given by $$\mathbf b(\mathbf a x \mathbf a)\mathbf b = \mathbf{ba} x \mathbf {ab}$$. Two reflections produce a rotation that we represent by the quaternion $$\mathbf q = \mathbf{ba}$$.

A pair of reflections through two vectors, and thus a quaternion, can rotate something only about an axis passing through the origin, and it cannot perform any kind of translation. To incorporate translations into a product like $$\mathbf q x \mathbf{\tilde q}$$, which would also allow us to rotate about arbitrary lines, we need to move up to dual quaternions. Dual quaternions constitute the even-graded elements of the 4D geometric algebra $$\mathbb R_{3,0,1}$$. The subscripts 3,0,1 come from Clifford algebra classifications, and they mean that three of the vector basis elements square to $$+1$$, none of them square to $$‒1$$, and one of them squares to $$0$$. Calling the basis elements $$\mathbf e_1$$, $$\mathbf e_2$$, $$\mathbf e_3$$, and $$\mathbf e_4$$, we have $$\mathbf e_1^2 = \mathbf e_2^2 = \mathbf e_3^2 = 1$$ and $$\mathbf e_4^2 = 0$$. There are 8 even-graded components in a dual quaternion, and we can write them as a pair of ordinary quaternions $$\mathbf q_r + \varepsilon \mathbf q_d$$, where $$\mathbf q_r$$ is called the real part, $$\mathbf q_d$$ is called the dual part, and $$\varepsilon = \mathbf e_{1234}$$ squares to zero. Dual quaternions operate on an object $$x$$ through a kind of sandwich product similar to the one used by quaternions: $$(\mathbf q_r + \varepsilon \mathbf q_d)x(\mathbf{\tilde q}_r - \varepsilon \mathbf{\tilde q}_d)$$, where multiplication is the geometric product. When the dual part $$\mathbf q_d$$ is zero, a dual quaternion just performs the rotation represented by the real part $$\mathbf q_r$$. To get a translation by the vector $$\mathbf t$$, we construct the dual quaternion $$1 + \varepsilon (\mathbf i t_x/2 + \mathbf j t_y/2 + \mathbf k t_z/2)$$. Products of dual quaternions corresponding to rotations and translations then give us the full range of rigid motions.

The conventional way in which publications teach you how to transform a point $$\mathbf p$$ with a dual quaternion is to first turn $$\mathbf p$$ into the dual quaternion $$1 + \varepsilon \mathbf i p_x + \varepsilon \mathbf j p_y + \varepsilon \mathbf k p_z$$, evaluate the product $$(\mathbf q_r + \varepsilon \mathbf q_d)(1 + \varepsilon \mathbf i p_x + \varepsilon \mathbf j p_y + \varepsilon \mathbf k p_z)(\mathbf{\tilde q}_r - \varepsilon \mathbf{\tilde q}_d)$$, and then pick off the coefficients of the $$\varepsilon \mathbf i$$, $$\varepsilon \mathbf j$$, and $$\varepsilon \mathbf k$$ terms to retrieve the result. This is a hack. What it’s really doing is casting $$\mathbf p$$ as a translation operator, transforming that operator with the dual quaternion, and then casting back to a point. It doesn’t extend to the richer set of geometric objects available in $$\mathbb R_{3,0,1}$$, which include vectors, bivectors, points, lines, and planes. With a dual quaternion $$\mathbf Q$$, what we really want is the ability to evaluate the product $$\mathbf Q x \mathbf{\tilde Q}$$ for any type of object $$x$$ and get a correctly transformed object of the same type as a result, just like we could do in 3D space with ordinary quaternions. In their SIGGRAPH 2019 course “Geometric Algebra for Computer Graphics”, the presenters point out that general $$\mathbf Q x \mathbf{\tilde Q}$$ transformations can be achieved by “turning the algebra on its head” and working with the so-called dual construction. In this formulation, homogeneous vectors represent planes, and homogeneous trivectors represent points, which is the opposite of what makes intuitive sense with respect to the dimensionality of those geometric objects. (Lines are still represented by homogeneous bivectors, but the parts that correspond to the direction and moment are reversed.) I think that requiring that things be done this way is a giant kludge that misses an important part of the big picture, and I find it disagreeable due to some of the problems that it causes. I’ll get back to those below.

The key to using dual quaternions in the proper way without having to resort to any hacks or dimensional reversals is found in the formula $$\mathbf f \vee \mathbf g$$ producing the line where the planes $$\mathbf f$$ and $$\mathbf g$$ intersect. Any rotation about an arbitrary line in 3D space can be decomposed into a pair of reflections through planes that intersect at that line, and the angle of rotation is twice the angle at which the planes meet. In order to capture information about the angle in an operator, we must use a geometric product and not just an exterior product. The problem is that the geometric product incorporates the wedge product $$\wedge$$ whereas the meet of two planes is derived from the antiwedge product $$\vee$$. The geometric product works fine for ordinary quaternions where two reflections through vectors $$\mathbf a$$ and $$\mathbf b$$ produce a rotation in the bivector $$\mathbf a \wedge \mathbf b$$, but it’s not the correct product where two reflections through planes $$\mathbf f$$ and $$\mathbf g$$ produce a rotation about the line $$\mathbf f \vee \mathbf g$$. Instead, we need the geometric analog of the antiwedge product. The existence of such a product follows from the fundamental property that everything in geometric algebra has a complement. (There is an automorphism on every geometric algebra in which elements and operations are mapped to their complements, and it produces the same structure.) The geometric antiproduct that we need complements the geometric product in the same way that the exterior antiproduct (the antiwedge product) complements the exterior product (the wedge product).

I have searched the literature for any mention of multiplication resembling the geometric antiproduct, but I have come up completely empty. As far as I know, it has never been introduced, and there is no notation for it. Unfortunately, because the geometric product is denoted by juxtaposition, we don’t have an infix operator that we can simply flip upside down like we could with the wedge and antiwedge products. I propose that we use the symbols $$\unicode{x27D1}$$ and $$\unicode{x27C7}$$ to denote the geometric product and geometric antiproduct, respectively, at least in contexts where a distinction is necessary. These symbols fittingly incorporate the fact that the geometric product between vectors combines their wedge product and dot product, and that the geometric antiproduct between antivectors combines their antiwedge product and antidot product. (The antidot product works with antivectors in the same way that the dot product works with vectors, but it produces an antiscalar quantity instead of a scalar quantity.)

The correct way to construct a dual quaternion $$\mathbf Q$$ from a pair of reflections through the planes $$\mathbf f$$ and $$\mathbf g$$ is by calculating $$\mathbf Q = \mathbf f \mathbin{\unicode{x27C7}} \mathbf g$$. This calculates the line $$\mathbf f \vee \mathbf g$$ and adds the value $$(f_xg_x + f_yg_y + f_zg_z)\mathbf e_{1234}$$ to it. If the planes $$\mathbf f$$ and $$\mathbf g$$ are normalized, then that additional antidot product is the cosine of the angle between the normal directions, which is half the angle of rotation. If $$\mathbf f$$ and $$\mathbf g$$ are parallel, then $$\mathbf Q$$ represents a translation along the normal direction by twice the distance separating the planes. In general, a unit-length dual quaternion $$\mathbf R$$ having the form

$$\mathbf R = (a_x \mathbf e_{41} + a_y \mathbf e_{42} + a_z \mathbf e_{43}) \sin(\phi/2) + \mathbf e_{1234} \cos(\phi/2)$$

is a pure rotation through the angle $$\phi$$ about the axis $$(a_x, a_y, a_z)$$. A dual quaternion $$\mathbf T$$ having the form

$$\mathbf T = (t_x/2)\mathbf e_{23} + (t_y/2)\mathbf e_{31} + (t_z/2)\mathbf e_{12} + \mathbf e_{1234}$$

is a pure translation by the vector $$\mathbf t$$. Combinations of these types of dual quaternions under the geometric antiproduct can be used to construct all rigid motions in three dimensions. Any object $$x$$, whether it be a point, line, plane, or any other member of $$\mathbb R_{3,0,1}$$, is transformed by a dual quaternion $$\mathbf Q$$ using the same sandwich product $$\mathbf Q \mathbin{\unicode{x27C7}} x \mathbin{\unicode{x27C7}} \smash{\mathbf{\underset{\Large\unicode{x7E}}{Q}}}$$. Here, the squiggle has been moved to the bottom to indicate that we are using the complement of the reverse operation, which we could call the antireverse. For dual quaternions, whether we use the reverse or antireverse doesn’t matter because they have the same effect on even-graded elements. But for other operators, such as a reflection through a single plane, or in geometric algebras for spaces of other dimensionality, it can make a difference in sign.

I’ve whipped up a poster-sized reference guide for projective geometric algebra in $$\mathbb R_{3,0,1}$$. It provides a lot of the details for geometric calculations in 4D Grassmann algebra, it contains the complete multiplication tables for both the geometric product and geometric antiproduct, and it shows explicit formulas for performing transformations with dual quaternions. (This reference guide has been doubled in size to include information from the next post, Symmetries in Projective Geometric Algebra.)

The authors of the SIGGRAPH course I mentioned earlier claimed that their dual construction was the only way to implement plane-based projective geometric algebra, but that is not true. Their failure to recognize the existence of the geometric antiproduct forced them to do many things backwards, and the result was an unnecessarily convoluted geometric model that resists intuition. While they’ve managed to make things work from a purely computational perspective, I perceive the quirks in their model as essentially aberrations derived from an incomplete picture of the mathematics. The following list summarizes the main problems that arise.

  • Their model requires that points be represented by trivectors and planes be represented by vectors. This is backwards. In 4D projective space, points are one-dimensional, and planes are three-dimensional. The projection into 3D space removes a dimension and naturally make points zero-dimensional and planes two-dimensional, but that’s not what they have. Furthermore, swapping points and planes has serious implications for nonorthogonal change-of-basis transformations, which happen in computer graphics all the time, but they completely ignore this issue.
  • Because points and planes are backwards, the geometric meaning of the wedge and antiwedge products are also necessarily backwards. Their model requires that $$\wedge$$ corresponds to a dimension-decreasing meet operation and $$\vee$$ corresponds to a dimension-increasing join operation, but in the Grassmann algebra used by the rest of the world, the meanings are the other way around.
  • Their concept of normalization is backwards. The projective dimension is represented by the basis element $$\mathbf e_4$$, and this means that an object in the projective algebra is normalized when the part that extends into this fourth dimension has a magnitude of one. For example, a homogeneous point is normalized when its $$\mathbf e_4$$ coordinate is one, a line is normalized when its $$(\mathbf e_{41}, \mathbf e_{42}, \mathbf e_{43})$$ direction has length one, and a plane is normalized when its $$(\mathbf e_{423}, \mathbf e_{431}, \mathbf e_{412})$$ normal has length one. This also applies to a dual quaternion, which is normalized when its $$(\mathbf e_{41}, \mathbf e_{42}, \mathbf e_{43}, \mathbf e_{1234})$$ rotor part has length one. In general, the magnitude of the collection of components involving the projective basis element $$\mathbf e_4$$ has to be one. However, in the dual construction model, its the components that don’t involve $$\mathbf e_4$$ that must have a magnitude of one.

This awkwardness is instantly cleaned up by using the product that naturally performs reflection through planes, the geometric antiproduct $$\unicode{x27C7}$$. Points and planes still have the right dimensionality, the wedge product still calculates the join, the antiwedge product still calculates the meet, and normalization always involves only the projective dimension. Nothing has to be flipped upside down or turned inside out, and nonorthogonal change-of-basis transformations have the correct effect on the geometry associated with elements of every grade. The lack of problems in the model produced by the geometric antiproduct and its natural elegance make it clear to me that it is the right way to go.

Keep in mind that the description above is extremely abbreviated, and there is a lot more that can be said about using dual quaternions to perform rigid motions. There are a lot of computational details on the reference poster, which is also available as a 18×24 inch print on Amazon. I will be dedicating an entire chapter to this subject in FGED3, where I will also cover its application to skinning.

See Also