Show HN: Rotation via Double Reflection (static.laszlokorte.de)
While studying Geometric Algebra I have built some interactive visualization to demonstrate how geometric transformations (rotation, scaling, translation) can be constructed by just composing reflections.
Accepting reflection as the most elementary geometric operation was an eye opening moment for me. I think some of you might enjoy the interactive visuals.
16 comments
[ 0.23 ms ] story [ 11.2 ms ] threadIt's also fairly simple to implement. I have implemented a version that rotates ASCII art, and that code made it to Ruby's list of sample programs:
https://github.com/ruby/ruby/tree/master/sample/trick2025/01...
> During this zic-zac motion across the plane the vector still rotates along the plane in the except same ways as in the 2d case above.
What is “the plane”? In 2D there is one single plane. In 3D every rotation rotated within a 2D plane and preserves the projection of the original vector to the orthogonal complement of the plane (which is just the distance from the plane and which side the original point is on).
In 4D and up, sorry, all of our nice 3D human intuition is wrong. You can rotate in two planes at once, and that’s not equivalent to a rotation in any given plane.
And indeed the article is pretty close to being a proof that the construction doesn’t work in 4+ dimensions. Reflection across a codimension-1 hyperplane (i.e. a n-1-dimension hyperplane) negates a single basis vector. Do two of these and the span of those vectors defines a 2D plane, and you get a rotation in that specific plane and no other. And this is insufficient to describe a general rotation.
Of course, in 4D, there are other sorts of reflection-ish operations, like how in 3D you can negate the x and y coordinates while leaving z alone. (That specific operation is, itself, a rotation and does not change parity!) I think that, if you are willing to appropriately stretch the idea of “reflection”, then you can generate all the rotations in higher dimension.
I think my mistake from the very beginning was to frame „reflection“ as happening around a vector instead of around a plane. I did this because I thought of it to be easier to vidualize. The I carried it on into 3d but as you say it does not generalize.
Had I started with doing reflections across planes I think it might generalize correctly across dimensions.
I have to admit this kind of mistake might completely undermine the correctness and usefulness of the visualization. I will rework this. Glad you noticed it.
You have vector s in blue, and then vector u in teal, and then vector v in orange.
In the diagram, it's "Subject", "First Reflector", "Second Reflector". I think it'd be better if these labels were "Subject s", "First Reflector u", "Second Reflector v" so that we can match up the text to the diagram even without color.
Later you have "The pair of vector u and v is called a rotor". But these colors do not match the earlier colors, and it makes it hard to connect to the diagram.
In the 3D diagram, I think it would be better if you used the same color scheme as for the 2D diagram. Same for the circular reflection diagram.
Suggested colors:
- subject s - orange in every diagram (currently blue, blue, blue) - first reflector - teal in every diagram (currently teal, magenta, pink) - second reflector - blue in every diagram (currently orange, teal, orange)
This makes the rotor colors more similar to each other than to the subject.