8/22/2026 at 2:55:35 PM
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...
by Sharlin
8/22/2026 at 10:54:13 PM
Alan Paeth's three-shear rotation is one of my favorite algorithms, especially because it's perfectly suited for rotating pixel art. Because shearing preserves all the original pixels, it even works with dithered images, unlike sampling-based rotation schemes.It'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...
by omoikane
8/22/2026 at 4:43:41 PM
Older versions of mspaint had shear but not rotation (to arbitrary angles), and you could use the same approach to achieve rotation via shearing.by Retr0id
8/22/2026 at 5:24:48 PM
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 trigonometryby ttoinou
8/22/2026 at 5:55:16 PM
Sure. Point is, this double-reflection construction is in no sense unique in requiring "no trigonometric functions".by Sharlin
8/23/2026 at 10:22:12 AM
Right, it’s not uniqueby ttoinou