I need to create an intersection method for the rectangle class that takes a rectangle and returns another rectangle representing the overlapping area.
for example, given:

if they overlap, I have to return the rectangle of the point (400 420) width = 50 height = 60.
source
share