1

Any idea on the formula if I rotate a 16:9 image to then Crop/Zoom in so the entire 16:9 screen is filled?

For example, when I angle my image by 4degrees, I have to zoom in my editing program which starts from 1.0 to 1.121 Here are 3 example

  • 4 = 1.121
  • 45 = 1.963
  • 90 = 1.777

The value goes higher for a 45-degree angle, so the graph is almost kinda sorta a Bell curve on a graph (not quite).

to put it another way, just like photoshop, if you rotate an image a little, how much do you have to zoom in to fill the boundaries again so there is no white space on the edges. 
MBo
  • 77,366
  • 5
  • 53
  • 86
SteveMylo
  • 13
  • 5

1 Answers1

0

If you have initial rectangle with height h and width w=16/9*h, then after rotation bounding rectangle has dimensions (here with picture):

H = 16/9 * h * Abs(Sin(Fi)) + h * Abs(Cos(Fi))
W = 16/9 * h * Abs(Cos(Fi)) + h * Abs(Sin(Fi))

Now needed coefficients by vertical and by horizontal axes:

cfvert = (16/9 * h * Abs(Sin(Fi)) + h * Abs(Cos(Fi))) / h = 
        16/9 * Abs(Sin(Fi)) + Abs(Cos(Fi))

cfhor =  (16/9 * h * Abs(Cos(Fi)) + h * Abs(Sin(Fi))) / (16/9 * h) = 
        Abs(Cos(Fi)) + 9/16 * Abs(Sin(Fi))

and result is maximum from these coefficients - definitely the first one:

coeff = max(cfvert, cfhor)  = 16/9 * Abs(Sin(Fi)) + Abs(Cos(Fi))  
MBo
  • 77,366
  • 5
  • 53
  • 86