Want to make a rotating background, find the minimum size in relation to the screen.

24 Views Asked by At

I am making a game, and want to make a rotating background. I want to find the minimum size the background needs to be in order to not get cut off in the middle of the rotation, so I went for a 45deg angle.

Here's an illustration:Illustration

I am just a high-school student, so I am not that great at math, I tried a couple of things (such as

$\sqrt{(\text{height} / 2)^4} + \sqrt{(\text{width} / 2)^4)}$

but that didn't work out too well...

1

There are 1 best solutions below

1
On BEST ANSWER

The diagonal of the screen is $D=\sqrt{W^2+H^2}$. When you rotate it, it remains inscribed in a circle having that diameter. This circle must itself be inscribed in a square of side $D$. (Rotating the square by $45°$ has no usefulness.)