# Interpreting geometric algebra

Geometric algebra has catched my attention again. Relatively small libraries such as ganja.js seem to provide very impressive results with a small footprint.

Some excitement wears off when you try to understand what's going on. The problem has been that I still don't understand how to read multivectors, or maybe I do but I'm not sure.

To be concrete lets pick up the `(2, 0, 0)`. This is an algebra where `e0² = e1² = 1`. We can treat `e0` and `e1` as orthogonal basis vectors. Our multivector ends up with the following elements:

``1 e0 e1 e0∧e1``

So we got real numbers there, but there may be a 1-blade part `(e0,e1)`, and a 2-blade part `(e0∧e1)`. The 2-blade is a "join" of vectors to form an oriented area.

1. Real number is just interpreted as a real number.
2. The 1-blade is a sum of basis vectors, we get a vector with direction and magnitude that is given by the `sqrt(v[e0]² + _v[e1]²)`.
3. The 2-blade is a sum of basis planes. We have only one plane so this is either a negative or positive magnitude that is associated to the plane.

Each of these quantities have a trivial interpretation. We got some quantity, then we have a direction with distance and an area. But what does it mean if you have a sum with a real number and 2-blade in it? Or 1-blade with a 2-blade?

Well, we have an easy interpretation for the individual fields. We got sums of magnitudes of different dimensions. Quantities, distances with directions and oriented areas. There perhaps doesn't need to be more interpretation until we have some more context.

For example if we multiply two vectors together, by the definition we get a sum of dot product and wedge product.

``a*b = a.b + a∧b``

The `a.b` ends up being `cos(y)*|a|*|b|`, that is angle between vectors, and the `a∧b` ends up being an oriented area of magnitude `sin(y)*|a|*|b|`, roughly corresponding to the plane and area of the parallelogram forming between the vectors.

## Projective geometric algebra

We may pick a different interpretation for the exterior algebra and we get a different kind of behavior. One interesting case is to treat `e0`, `e1`, `e2` as a line equation:

``a*e0 + b*e1 + c*e2 = 0``

Now if we pick `(2,0,1)` and we get `e0² = 0`, `e1² = e2² = 1`. The dot product starts giving us information about angles between lines described by `e0, e1, e2`.

The multivector ends up with the following components:

``1 e0 e1 e2 e0∧e1 e1∧e2 e2∧e0 e0∧e1∧e2``

The wedge-product in this system means for intersection between things. `x∧y` ends up being the point where two lines `x` and `y` intersect. This gives an interpretation for the other fields. We got intersections of two lines, and intersections of three lines. Three line intersections are a bizarre concept though.

But at least we can interpret the 2-blade as some kind of a point now.

Lets dig into what we get.

``(a*e0 + b*e1 + c*e2)∧(h*e0 + i*e1 + j*e2)``

The wedge product can be moved over the addition.

``````  a*e0∧(h*e0 + i*e1 + j*e2)
``````+ b*e1∧(h*e0 + i*e1 + j*e2)
````+ c*e2∧(h*e0 + i*e1 + j*e2)````

Then lets apply the rule `a∧a = 0`.

``````  a*e0∧(       i*e1 + j*e2)
``````+ b*e1∧(h*e0 +      + j*e2)
````+ c*e2∧(h*e0 + i*e1 +     )````

Finally we expand this out:

``````  (            a*i*e0∧e1 + a*j*e0∧e2)
``````+ (b*h*e1∧e0 +           + b*j*e1∧e2)
````+ (c*h*e2∧e0 + c*i*e2∧e1 +          )````

And lets produce a multivector:

``   (ai-bh)*e0∧e1 + (aj-ch)*e0∧e2 + (bj-ci)*e1∧e2``

In homogeneous coordinates the intersection of two lines is given by:

``ch - aj, ai - bh, bj - ci``

We got our third coordinate at the `e1∧e2`. `e0∧e1` seem to be the y-coordinate and `e2∧e0` seem to be the x-coordinate.

Now geometric product between two lines is interpreted to give the angle between lines and their intersection point.

So all of this is still fairly bizarre, but maybe the whole thing here is exactly like it is with the imaginary number.

``````i² = -1
``````sqrt(-1) = i
````sqrt(-a) = i*sqrt(a)````

Therefore we can treat the imaginary number as a shorthand for:

``a + b*i = a + sqrt(-b²)``

A number that does not resolve to a constant doesn't have an interpretation as a number. It's a number that is outside our solution space. `b` descibes how far outside it is from that.

However the imaginary number allows to produce an intermediate result and subsequent calculations may resolve.

We perhaps have something similar going on with geometric algebra.