2

Possible Duplicate:
Calculate Bounding box coordinates from a rotated rectangle, Picture inside
AABB of rotated sprite?

I have a rectangle with a width of w and height of h. I rotate the rectangle r degrees(originating at its center point).

How can I determine the width(w2) and height(h2) of the bounding box after the rotation.

enter image description here

Community
  • 1
  • 1
Mike
  • 2,862
  • 10
  • 42
  • 55
  • 1
    I don't think it is a duplicate because I don't have any coordinates of the rectangle and I am not looking for the min and max of the bounding box. I am looking for the width and height. – Mike Apr 16 '12 at 15:45
  • `width = max_x - min_x` and `height = max_y - min_y`. No? – Matt Ball Apr 16 '12 at 15:48
  • Correct but I think its irrelevant since I don't know min_x,max_x,min_y,max_y. And I don't believe it could be calculated with the information that is given. But I think the width and height could be calculated directly somehow, I just don't know how. – Mike Apr 16 '12 at 15:51
  • 3
    Might be more appropriate on math.stackexchange.com – Dan W Apr 16 '12 at 15:53
  • Dan W is correct, I ended up finding the answer on math.stackexchange. Also it turns out Gareth is correct too that this is a duplicate of the question he linked to and the answer is provided there. – Mike Apr 16 '12 at 17:27
  • Does this question belong here? How do you relate it to programming? – Surya Apr 16 '12 at 17:37

0 Answers0