Hacker News new | ask | show | jobs
by arh68 3491 days ago
What would that look like, code-wise? Is there a good library for this stuff?

It's easy to reach for complex numbers when they're built-in. Do you have to use Maple/Mathematica for this stuff, or can you do it easily in Python/JS/&c ?

2 comments

If you are interested in this stuff, I have heard that the book Geometric Algebra for Computer Science is good.

You can find the first chapter as a pdf download here: http://geometricalgebra.org/downloads/ga4cs_chapter1.pdf. It contains some code examples, and the complete source code is here: http://geometricalgebra.org/sandbox.html

I made a list recently: https://news.ycombinator.com/item?id=12941658

The GACS book is indeed great. The “conformal model” defined there is very pleasant to work with. If you want to learn about it without buying a textbook, there’s also this PhD thesis: http://www2.eng.cam.ac.uk/~rjw57/pdf/r_wareham_pdh_thesis.pd...

Well, implementing rotation matrices in code isn't hard, and they should be supported in every mathematical library already.

Even more lightweight than matrices is just implementing the transformation on vector objects yourself: a 90-degree rotation left is R(x,y) = (-y, x), and (-R)(x,y) = -(R(x,y)). In higher dimensions this remains true for any 2-dimension subplane, so R_zx(x,y,z) = (z,y,-x).

Rotation matrices / other formulations become necessary when you're dealing with being able to rotate through any angle.

Though, doing rotations of the matrix 'y = Rx' form suffers mathematical problems like numerical instability and bad behavior. Quaternion rotations or Geometric Algebra's rotors (which are equivalent for N=3, and both take the form y = RxR^-1) work a lot better, and also eliminate a lot of the redundancy in the (skew-symmetric) rotation matrices formulation (4 variables instead of 9, for 3d).