biVector forum

Discrepancy between ganja.js cheatsheet and code?

Hi all,

I’m just beginning to learn about GA, so please forgive my ignorance.

The "2D Euclidean Projective GA \cong \R_{2,0,1}" section of the ganga.js cheatsheet gives the formula for a point as e_{12} + xe_{01} + ye_{02}

Yet in the points and lines coffeeshop example, the following javascript function is used:

var point = (x,y) => 1e12 - x*1e02 + y*1e01;

However, this formula actually seems to produce the point (x,-y) in the sense that greater y values move points further down the screen, so it seems like the correct function should be

var point = (x,y) => 1e12 - x*1e02 - y*1e01;

It seems that the discrepancy between the second and third formula is due to the SVG coordinate system using an inverted y-axis. Can someone confirm or deny this?

But that still leaves me wondering why neither of them agree with the cheatsheet. Does this discrepancy have something to do with duality?

Any insight would be very helpful! I’m excited to be learning about GA.


Taking a hint from the PGA2D section of the Github README, I’m suspecting that the minus sign in the second formula is because e_{02} = -e_{20}, and e_{20} has the proper cyclic index ordering.

But that still doesn’t quite explain it, since the cheatsheet uses e_{02}, not e_{20}. And the x and y blades are swapped. So I guess I’m still confused :man_shrugging:

Hey @Oliver_Evans,

If you play around with the coordinates there, you’ll find that the y-scale advances downwards (this is a common screenspace convention in computer graphics). No duality at play here, simply a choice of basis-direction I believe.