Rotating images: how does it work?

• Question
• Updated 6 years ago
I have to make dissertation for mathematics this schoolyear. I'm studying the link between mathematics and photography. Now I want to know how images are rotated in Photoshop or other photo software. I found out that it has to do with complex numbers because you can rotate every pixel in the complex plane, but I can't find any source that explains how this mathematical theory is implemented in the software.

Does anyone know how they do it?

I really want to find out how it actually works, so I can make a good dissertation.
• 1 Post

Posted 6 years ago

• 242 Posts
Back in the day when I was playing with image processing I used the 3 shear method.

Shear 1: x' = x - tan (theta/2) * y
Shear 2: y' = y + sin(theta) * x
Shear 3: x' = x - tan (theta/2) * y

Rory
• 4831 Posts
Crop rotation in Lightroom:

x' = x * Cos(theta) - y * Sin(theta) + a
y' = x * Sin(theta) + y * Cos(theta) + b

(formula originally provided by Steve Sprengel)

ref_1: http://feedback.photoshop.com/photosh...