Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Find new width and height of a rotated item

807588Jun 2 2009 — edited Jun 2 2009
hi all,

I have an issue where I have a rectangle that I rotate and I need to know the new width and height of the bounding box of the rectangle when it has been rotated

example:

I have this rectangle shape

****
****
****
****

so its known width and height is 20pixels x 60pixels

now i rotate the rectangle by 90 degrees

so it looks like this

**********
**********

now its 60pixels x 20 pixels

but all i know is the width height is 20 x 60

how do I calculate the new width and height after rotation?

obviously a rotation of 45 degrees would mean the bounding box will not be 20 x 60 or 60 x 20 so I need to take that into consideration

thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 30 2009
Added on Jun 2 2009
5 comments
910 views