0

I looked at this post (Java check if two rectangles overlap at any point) to check the overlap of two rectangles. example image

Now i need to know the size of red rectangle. How can i do it?

I reformulate the question as seen in the image, I need to know the size of each red sub-rectangle Thank you in advance. Pasquale

1 Answers1

0

Subtract the furthest-left side of the right-most rectangle from the furthest-right side of the left-most rectangle to get the width.

You can get the height using a similar technique with the Y axis.

khriskooper
  • 767
  • 8
  • 18