Show HN: Rotation via Double Reflection

(static.laszlokorte.de)

40 points | by laszlokorte 1 day ago

5 comments

  • Sharlin 3 hours ago
    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...

    • ttoinou 1 hour ago
      Because an "angle" is by definition trigonometric, it's a ratio of a circle perimeter. You can also use an angle already formed by two vectors and won't need trigonometry. You can also use others things than trigonometric angles, such as spread from rational trigonometry
      • Sharlin 45 minutes ago
        Sure. Point is, this double-reflection construction is in no sense unique in requiring "no trigonometric functions".
    • Retr0id 1 hour ago
      Older versions of mspaint had shear but not rotation (to arbitrary angles), and you could use the same approach to achieve rotation via shearing.
  • amluto 1 hour ago
    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.

  • kazinator 2 hours ago
    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.
  • zkmon 3 hours ago
    There is no mystery. Imagine a huge radius of rotation. Then a small rotation is almost like a linear shift due to the large radius. Two reflections around a small angle would mean two "half roll-overs" making it a full roll-over. That means you just shifted (rotated) the thing.
  • RIshabh235 2 hours ago
    Great work