Hacker News new | ask | show | jobs
by ThrustVectoring 3490 days ago
i is a rotation operator in R3 as well - it's just a 3-vector instead of a 1-vector, and textbooks usually call these "quaternions".

If you do want to think of geometry in terms of linear algebra structures, you probably want to be studying Geometric Algebra.

1 comments

ah, I'm aware of those things and have studied them extensively --

My point is, I think it's harmful to say "hey, you - you're trying to solve a problem in 2d space? Have you considered using complex numbers?" When the correct thing to do is "have you considered using the algebra of N-d spaces?" (that is, Clifford/geometric algebra), and leave all the magical complex numbers out of it.

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 ?

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).