Hi @nwikner,

The answers posted are correct. However, I’d like to take the opportunity to point out some possible pitfalls that are lurking when you use the results for further calculations.

Note that most of the formulas on the cheat sheets, including the midpoint formula, assume that their arguments have been *normalized*, that is, X \widetilde X = \pm 1.

For a point in 2D euclidean PGA that means that it is of the form e_0 + x e_1 + y e_2, that is, the

coefficient of the e_0 term is 1. If that isn’t the case, then the point can be normalized by dividing by that coefficient. (After all, PGA is *projective* geometric algebra, and in projective geometry multiplying by a non-zero scalar doesn’t change the geometric primitive).

So the precise statement of the formula is that A+B is the midpoint M of A and B when A and B are normalized. Otherwise, you have to use the more cumbersome formula

M = \dfrac{A}{\|A\|} + \dfrac{B}{\| B \|},

that is obtained by normalizing the arguments before applying the formula.

The ganja demo posted on this thread creates normalized points, so you can confidently apply the formulas to these points. But when you go to feed the results to further calculations, you have to be careful.

In this example, A+B will be the desired midpoint, but it will **not** be normalized. If

A = e_0 + x_a e_1 + y_a e_2 and

B= e_0 + x_b e_1 + y_b e_2, then

A+B = 2 e_0 + (x_a+x_b)e_1 + (y_a+y_b) e_2.

So to normalize A+B, you have to divide by two:

M := A+B = e_0 + \dfrac{(x_a+x_b)}{2}e_1 + \dfrac{(y_a+y_b)}{2} e_2.

You should recognize the formula for the midpoint of two points here.

Using M you can find the midpoint of A+B and B:

M + B = e_0 + \dfrac{(x_a+3 x_b)}{4}e_1 + \dfrac{(y_a+3 y_b)}{4} e_2

which is the point \dfrac34 of the way from A to B, as it should be.

Without normalizing A+B, you obtain (before normalizing):

(A+B)+B = A + 2B = 3 e_0 + (x_a+2x_b)e_1 +(y_a+2 y_b) e_2

Which normalized is

e_0 + \dfrac{(x_a+2 x_b)}{3}e_1 + \dfrac{(y_a+2 y_b)}{3} e_2

which is the point \dfrac23 of the way from A to B: not correct.

I’ve extended Steven’s ganja demo to include the correct and incorrect results obtained above:

https://enkimute.github.io/ganja.js/examples/coffeeshop.html#2HKZUgmYA

The moral: always remember to normalize the results of your operations before feeding them to further calculations based on the formulas of the cheat sheets.