Hello, hellzone!

I have a resizeable plane (say, 300 x 300 in size).

On this plane I have a square (say, 290 x 290 in size).

When i rotate this square on this plane by. say $\displaystyle 25^o$ about the square's center.

parts of the square are no longer visible on the existing plane.

My goal is to have the plane resize based on the new square

but all I have available is the original dimensions of the plane,

the original dimensions of the square and the angle it's being rotated by.

Basically i'm looking for an equation which would take the angle and dimensions

of the original square and plane and produce the new correct dimensions

for the plane so that it engulfs the new square

Assuming that the square *must* be 290 units on a side,

. . the worst case scenario occurs when it is rotated $\displaystyle 45^o.$

Code:

*
* *
290 * * 290
* *
* *
* - - - - - - - - - *
* x *
* *
* *
* *
*

In the right triangle, we have: .$\displaystyle x^2 \:=\:290^2 + 290^2$

Then: .$\displaystyle x^2 \:=\:2\cdot290^2 \quad\Rightarrow\quad x \:=\:290\sqrt{2} \:=\:410.1219331$

Rounding *up*, we have 411.

Therefore, the plane must be *at least* $\displaystyle 411 \times 411.$

In general, for a square of side $\displaystyle \,a$,

. . the plane must be at least $\displaystyle \left\lceil a\sqrt{2}\,\right\rceil \times \left\lceil a\sqrt{2}\,\right\rceil$

. . where $\displaystyle \lceil x\rceil$ is the "round up" function.