[Math] Find coordinates of bounding box corners of rotated rectangle

coordinate systemsgeometrytrigonometry

I have a rotated rectangle inside a bounding box. It can be rotated to any angle.

I know the coordinates of the "top left" corner of the inside rectangle (and I am able to work out the other 3 points, and the centre point). I also know the full length of the top of the bounding box.

I need to be able to figure out the coords of the bounding box corners or the length of the edges, where the inner rectangles corners intersect.

See the image, I need to find out what the ? is.

Best Answer

In your case, each coordinate of each corner of the bounding axis-aligned rectangle is obtained by taking the minimum or maximum as appropriate of the corresponding coordinate of your original (rotated) rectangle.

Related Question