I need an algorithm to solve this problem: Given 2 rectangles intersecting or overlapping together in any corner, how do I determine the total area for the two rectangles wi
The coordinates of intersection are correct if the origin (0,0) is placed at the bottom-left of the reference system.
In image processing, where the origin (0,0) is usually placed at the top-left of the reference system, the coordinates bottom and top of intersection would be:
bottom = min(r1.bottom, r2.bottom)
top = max(r1.top, r2.top)