I'm doing a coding challenge in which I have to write a formula that returns the intersection of two rectangles. But before I do that, I want to attempt this mathematically. Can anyone provide resources to familiarize myself with on how to calculate the intersection of two rectangles? Any resources or information will be helpful.
ETA: So one way of determining an intersection is to see if one corner (top left) of rectangle A is above the corner (top left) of rectangle B.
Any other way?