# rectangle rotation

• May 4th 2007, 02:32 AM
kumar
rectangle rotation
I have to rotate a rectangle with some angle. after rotation I have to calculate howmuch width and height rectangle going to occpy. How to calculate width and height after rotation?
• May 4th 2007, 03:42 AM
ThePerfectHacker
Quote:

Originally Posted by kumar
I have to rotate a rectangle with some angle. after rotation I have to calculate howmuch width and height rectangle going to occpy. How to calculate width and height after rotation?

Rotation is an isometry. The length of width and height remain the same. What is your problem?
• May 4th 2007, 03:49 AM
Soroban
Hello, kumar!

Quote:

I have to rotate a rectangle with some angle.
After rotation I have to calculate how much width and height rectangle will occupy.
How to calculate width and height after rotation?

Let L be the length and W be the width of the rectangle.
Let θ be the angle of rotation: .< θ < 180°

The diagram looks like this:
Code:

```     + - - - - - - - - - * - - - - + -     :            θ  *    *        :     :          *        *      :     :      *  L          *      :     :  *                  *    : W·cosθ     *                      W *    :     :*                        *  :     : *                        * θ:     :θ *                        * :     :  *                        *:     :    * W                      * -     :    *            L    *  :     :      *              *      :     :      *        *          : L·sinθ     :        *    *  θ            :     + - - - - * - - - - - - - - - + -     | W·sinθ  |      L·cosθ      |```
• May 4th 2007, 03:53 AM
CaptainBlack
Quote:

Originally Posted by kumar
I have to rotate a rectangle with some angle. after rotation I have to calculate howmuch width and height rectangle going to occpy. How to calculate width and height after rotation?

First draw a diagram, see attachment.

RonL
• May 4th 2007, 04:00 AM
kumar
Quote:

Originally Posted by CaptainBlack
First draw a diagram, see attachment.

RonL

Ya, I have to calculate w2 and h2 for different angles
• May 4th 2007, 04:32 AM
Soroban
Hello, kumar!

Didn't I give you the formulas?

. . L
2 .= .L·cosθ + W·sinθ

. .W
2 .= .L·sinθ + W·cosθ

• May 4th 2007, 04:44 AM
kumar
Thanks
Quote:

Originally Posted by Soroban
Hello, kumar!

Didn't I give you the formulas?

. . L2 .= .L·cosθ + W·sinθ

. .W2 .= .L·sinθ + W·cosθ

Thanks soroban, I am trying with that formulas.
• May 4th 2007, 05:12 AM
kumar
My Rectangle height is 13.8
Rectangle Width is 40.6
rotation angle is 30 degree.
I am using the below formula

but I am not getting correct widht and height. Its giving some -ive values for height

its giving height as -8.3
widht as 28.3
• May 4th 2007, 07:26 AM
topsquark
Quote:

Originally Posted by kumar
My Rectangle height is 13.8
Rectangle Width is 40.6
rotation angle is 30 degree.
I am using the below formula