Thank you all for replying.
Perhaps my usage of the word "union" was incorrect and "intersection" more appropriate.
I had not considered collision detection, as I assumed that would simply tell me *if* they overlapped, not the polygon defining that overlap.
For both rectangles R1 and R2, I...
I'm trying to write an algorithm that will take in, as parameters, two rectangles R1 and R2 and calculate their union.
R1 and R2 may be in rotated (independently), one may be completely inside the other, or they may not be overlapping at all.
Example(Image):
The algorithm I wrote currently...