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?

Printable View

- May 4th 2007, 02:32 AMkumarrectangle 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 AMThePerfectHacker
- May 4th 2007, 03:49 AMSoroban
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: .0°__<__θ__<__180°

The diagram looks like this:Code:

+ - - - - - - - - - * - - - - + -

: θ * * :

: * * :

: * L * :

: * * : W·cosθ

* W * :

:* * :

: * * θ:

:θ * * :

: * *:

: * W * -

: * L * :

: * * :

: * * : L·sinθ

: * * θ :

+ - - - - * - - - - - - - - - + -

| W·sinθ | L·cosθ |

- May 4th 2007, 03:53 AMCaptainBlack
- May 4th 2007, 04:00 AMkumar
- May 4th 2007, 04:32 AMSoroban
Hello, kumar!

Didn't I give you the formulas?

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

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

- May 4th 2007, 04:44 AMkumarThanks
- May 4th 2007, 05:12 AMkumar
My Rectangle height is 13.8

Rectangle Width is 40.6

rotation angle is 30 degree.

I am using the below formula

newHeight = ( (Height*cos(radians)) + (Width*sin(radians)) )

newWidth = ( (Height * sin(radians)) + (Width * cos(radians)) )

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 AMtopsquark
Using Soroban's formula (which I haven't checked for myself, but he's usually trustworthy :) ) I'm not getting your numbers. Make sure your calculator is in DEGREE mode if you are using an angle in degrees. And given a 30 degree angle I see no way that the height can sensibly be negative from that formula since all quantities are positive.

-Dan