Rotating images: how does it work?

  • 1
  • Question
  • Updated 5 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.
Photo of Bert M

Bert M

  • 1 Post
  • 0 Reply Likes

Posted 5 years ago

  • 1
Photo of Rory Hill

Rory Hill

  • 234 Posts
  • 33 Reply Likes
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

You can google this to get more info.

Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 370 Reply Likes
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)


Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 748 Reply Likes
here's the book on warping, rotations, etc.

Basic computer graphics texts will also provide simpler explanations:

Most colleges will have copies of these books (or earlier editions).