Show HN: Rotation via Double Reflection

(static.laszlokorte.de)

18 points | by laszlokorte 22 hours ago

3 comments

  • Sharlin 56 minutes 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...

  • RIshabh235 1 minute ago
    Great work
  • zkmon 52 minutes 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.