I have an image that has a resolution of 768 x 662 (width x height). In this image there is another image which is tilted by 30 degrees.
Can I use these existing values (Resolution and Rotation) to calculate the resolution of the rotated image inside? If yes, how? Theoretically, the result in this example should output a longer width and a shorter height.
Let the inner picture have dimensions $ a \times b $ where side $a$ makes an angle of $30^\circ$ with the positive horizontal direction.
It follows that
$ 768 = a \cos 30^\circ + b \sin 30^\circ $
$ 662 = a \sin 30^\circ + b \cos 30^\circ $
which are two linear equations in the two unknowns $a$ and $b$. It follows using Cramer's rule of solution that
$ a = \dfrac{ 768 \cos 30^\circ - 662 \sin 30^\circ }{ \cos^2 30^\circ - \sin^2 30^\circ } $
$ b = \dfrac{ 662 \cos 30^\circ - 768 \sin 30^\circ} { \cos^2 30^\circ - \sin^2 30^\circ } $
This evaluates to
$ a = 668 $
$b = 379 $