Designing Geometric Algebras - Part 1
Typically we choose a Geometric Algebra that will work well with our problem. First there are the object types the different GAs can represent. If we want flat objects such as lines and planes going through the origin ordinary GA works. If we additionally want the objects to be at arbitrary positions PGA is a good choice. For spheres we can choose CGA which can directly represent them. Secondly we might need certain operations which also dictates our choice of GA. Ordinary GA has rotors that can do rotations only. With both PGA and CGA we get rotors which can do translation and rotation. Below is a table of a few already explored GAs and their properties.
So if what we need is contained in one of these we can simply use them and benefit from the previous exploration done within them. What if we need something that is not contained in one of these pre-made GAs though? Is there a way to create exactly what we need? In the first part of this article we will try to figure out how to create a GA that contains the objects we want. Specifically we will try to create a GA containing arbitrary polynomial shapes such as parabolas and elliptic curves. In the second part we will also look at the rotors.
|Ordinary GA||N, 0, 0||Flat (through origin)||Rotation|
|Projective Geometric Algebra||N, 0, 1||Flat||Rotation, Translation|
|Conformal Geometric Algebra||N+1, 1, 0||Flat, Round||Rotation, Translation|
|Conic Geometric Algebra||5, 3, 0||Conics (2D)||Rotation, Translation, Uniform scaling|
|Quadric Geometric Algebra||9, 6, 0||Quadrics (3D)||Rotation, Translation, Uniform scaling|
How are objects represented outside of GA?
Before jumping into GA we should take a step back and remember how we represented objects in algebra before.
Usually we represent a 2D line by the linear equation
, a circle at the origin by and so on. Rearranging this a bit to bring everything to the same side we get equivalently and . The object is then represented by all the points for which these equations are true, that is, for which the left hand side evaluates to zero. We call this the null space or kernel of the function.
Object representation in GA
Now jumping to GA, in 2D PGA a point is represented by a bivector
and a line is represented by a vector . Let's call the mapping for points the function: Here's a table of the previously mentioned algebras and their up functions. Note that some of these use a dual representation for points (points as pseudovectors) and some use the usual representation (points as vectors).
How do we connect these representations to the usual null-space representation? There are two almost equivalent ways of doing this.
|Projective Geometric Algebra|
|Conformal Geometric Algebra|
|Conic Geometric Algebra|
|Quadric Geometric Algebra|
Inner Product Null Space Representation
The first one is the Inner Product Null Space (IPNS) representation. Here we say that the inner product of our object, let's call it
, is zero for an arbitrary point produced by our up function. The IPNS representation has the downside that we need to define a metric so the inner product works. This means that the representation depends on what our basis vectors square to. This also doesn't work for degenerate metrics such as the one used by PGA.
Outer Product Null Space Representation
The second representation is the Outer Product Null Space (OPNS) representation. Instead of the inner product we use the outer product which means we don't need to define a metric either and this will work the same regardless of what our basis vectors square to. We wedge our object
with an arbitrary point produced by our up function. The intuition here is that if points are represented by vectors then represents the join operation. If we try to join a point that already lies on the object we get zero. Note that if we're using a dual representation (points as pseudovectors) then we need to use instead as that is then the join operation (maybe a better name would then be the Vee Product Null Space (VPNS)?).
We will continue using OPNS from now on and apply it to recover more familiar equations for the objects.
Example: OPNS applied to PGA 2D
Let's apply the OPNS equation to see what a vector in 2D PGA represents. For the arbitrary
we need to use a pseudovector. The function gives us a pseudovector (bivector in this case) so let's use it in place of and remember that we need to use for dual representations. We have recovered the usual equation for a line. Unlike the previous one, this one also has a coefficient for which makes it possible to represent vertical lines (by setting we get ). Hence the vectors in 2D PGA represent lines.
What happens when we apply the OPNS to PGA points (pseudovectors, bivectors in 2D)?
We get three equations that have to vanish, only two of which are independent. The coordinates we extract get divided by the part of the point. We automatically get homogeneous space and projective points just by defining the up function the way we did with the constant coefficient term .
As a final note, applying OPNS is like finding an inverse for the up function. For points it indeed gives the inverse mapping (ie. as if we just inverted the function directly) but the OPNS also generalizes it to apply to elements other than points in a consistent manner.
Representing polynomials in GA
Looking at how we arrived at the equation for a line from the OPNS equation we can see that the coefficients
came from the object whose representation we're trying to understand, but the variables , and (for ) came from how we defined the function. This means that if we wanted to represent different shapes we need to change the function.
As an example, if we wanted to represent parabolas, we would need to have a basis vector that has
as a coefficient in . For example would give us after applying the OPNS equation.
Another interesting observation here is that we have a constant term in the polynomial which comes from the fact that we add a constant bivector
in the up function. This allows PGA to represent translated objects unlike ordinary GA which can only represent objects through the origin.
Furthermore the number of basis vectors is arbitrary. For each term we want we can simply add another basis vector with our desired coefficient. Finally as already mentioned before, the OPNS does not depend on the metric so the interpretation works regardless of what the basis vectors square to.
Example: Elliptic curves in GA
Looking at the Wikipedia article for elliptic curveswe can find that the equation for an elliptic curve is
. So to represent them we need 4 terms in our up function with coefficients . As a result we will need 4 basis vectors (with any signature). Vectors will now be able to represent elliptic curves as well as other simpler curves (parabolas, cubics, lines, ...). You can verify this by hand (or ideally using symbolic math software) by applying the OPNS equation to a vector as before in the 2D PGA example.
Join and meet
If points are represented by vectors the join is
and meet is . In algebras that uses a dual representation for points such as PGA this is swapped and join is and meet is .
Something interesting happens when we look at the meet operation which returns the intersection object of two objects. In PGA when we intersected two straight lines we get a single point (or point at infinity if the lines are parallel). However with more complicated curves such as parabolas or elliptic curves we will get more than one intersection point. For example intersecting a parabola with a line (assuming they intersect) will result in two points. However the representation for such a point pair is identical to the representation of a single point in PGA. The difference will only be visible once we apply the OPNS equation to find out what our object is actually representing.
Example: parabola at origin intersects horizontal line
Let's apply what we have just learnt and look at some actual results to see if they make sense. We want to intersect a parabola at the origin of the form
with a horizontal line of the form . We would expect the intersection to contain 2 points (assuming they intersect).
From the two equations we see that we need the terms
, and and thus we require 3 basis vectors. We'll use a dual representation (points as pseudovectors) and define our up function as follows Now curves should be represented by vectors. For our parabola we need the and basis vectors, that is and respectively. For our line we will need the and basis vectors, that is and respectively. Let's look at the OPNS (using ) for to confirm it indeed represents the desired parabola. Looks like we're good! Now we can intersect the two objects using as that is the meet operation in the dual representation. We will call the intersection object . Now let's look at the OPNS of the intersection object to see if it gives us what we expect (two points of intersection). Now we have three vectors that need to each be equal to zero. The three equations aren't independent (combining the first and third one gives the second one). So now we see that the intersection object represents and . This has two solutions as expected and the solutions are the correct ones too (eg. is just the vertical offset of the line).
Great, we have shown that what we learnt makes sense and can be applied without much thought required. We can even plot the solutions using a library that can plot the null space of the algebraic equations implicitly.
Example: Intersecting Elliptic Curves
Here's another fun example to demonstrate join and meet on elliptic curves.
We have learnt how to represent arbitrary polynomials using GA and that intersection and joining them works and makes sense. There are some other things that we could explore. For example nothing stops us from using more complicated up functions than polynomials and there is no reason they should not make sense anymore.
The major thing we are still missing are operations on objects such as rotation and translation for which we want rotors. For these the metric and whether we use a dual representation or not will actually matter. That will be the topic of the next section.