assume for each coordinate: {x1, y1}: lower left, {x2, y2}: upper right
inter_x1 = max(x1, x1)
inter_y1 = max(y1, y1)
inter_x2 = min(x2, x2)
inter_y2 = min(y2, y2)
then we can calculate the intersection and union
assume for each coordinate: {x1, y1}: lower left, {x2, y2}: upper right
inter_x1 = max(x1, x1)
inter_y1 = max(y1, y1)
inter_x2 = min(x2, x2)
inter_y2 = min(y2, y2)
then we can calculate the intersection and union