Rotor Reflect - Interactive Double Reflection Rotation Demo

Show HN: Rotation via Double Reflection

Rotor Reflect is an interactive visualization demonstrating how any rotation can be achieved through two successive reflections, a core concept in Geometric Algebra. By dragging the rotor arc, users can adjust the reflection vectors and observe the subject vector rotating in real-time, with components and interim results clearly displayed. The tool also explores 3D rotations and circular reflections (circle inversion), showcasing the generalization of reflection-based transformations. No trigonometric functions are used, highlighting the elegance of this geometric approach. Ideal for educators, students, and enthusiasts of mathematics and computer graphics.

The construction of any transformation by only composing reflections sits at the core of Geometric Algebra.
  1. Sharlin

    To construct the two vectors spanning a given angle (well, as the article says, one of them can be chosen arbitrarily, the easiest is to just use (1, 0)), you'll of course need trigonometric functions. This is exactly equivalent to how constructing a rotation matrix from an angle requires trigonometric functions, but after that you can rotate how many vectors you like with just dot products, or how constructing e^ai = sin(a) + cos(a)*i requires trigonometric functions, but after that it's just complex multiplication.

    Another fun way to decompose 2D rotation is into three shears, originally given by Paeth in 1986: https://silmon.github.io/arbitrary-image-rotation-using-shea...

  2. amluto

    The dimension section triggered my “vague math” spider sense:

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

  3. kazinator

    Note that to reflect a rigid, physical model of a 2D shape, you have to rotate it around the reflection axis in 3D space. I.e. reflection is just a rotation involving a temporarily borrowed extra dimension.

More from this day

2026-08-22