I'm developing a website. For design I need to calculate the angle of a rectangle which is needed to get the top left corner in a vertical line with the bottom right one.
Example: I've a square/rectangle with the dimensions 10×10 cm (or inch/pixels, doesn't matter). To get the top left corner in the same vertical line as the bottom right corner, you need to rotate it 45 degrees.
How do I calculate that angle? When i've the dimensions 312×64 (Height × Width) cm for instance.
I've tried with Angle = Width × (90 / (Width + Height))
. But the result was incorrect.
I'm absolutely not a mathematician, so i'm sorry if this question is almost to simple to answer. Here an image describing the problem.