How to calculate distance from center of a rectangle to sides of the convex hull after rotation?

259 Views Asked by At

Knowing the dimensions of the rectangle ABCD, how can we calculate the distances OE and OF after a rotation with an angle=α?enter image description here

1

There are 1 best solutions below

0
Mahfoud B. On

I have fine the answer of my question in a response to this question: Find the Bounding Rectangle of Rotated Rectangle [duplicate]

It was written by @MBo like this:

Old_Width = X2_Old - X1_Old, Old_Height = Y2_Old - Y1_Old
New_Height = Old_Width * Abs(Sin(Fi)) + Old_Height * Abs(Cos(Fi))
New_Width = Old_Width * Abs(Cos(Fi)) + Old_Height * Abs(Sin(Fi))
X1_New = X1_Old - (New_Width - OldWidth) / 2 = 
         (X1_Old + X2_Old - New_Width) / 2