# 836. Rectangle Overlap

{% embed url="<https://leetcode.com/problems/rectangle-overlap/>" %}

平面几何题？？

```python
class Solution:
    def isRectangleOverlap(self, rec1: List[int], rec2: List[int]) -> bool:
        ax1, ay1, ax2, ay2 = rec1
        bx1, by1, bx2, by2 = rec2
        if max(ax1, ax2) > min(bx1, bx2):    #矩形1最右端大于矩形2最左端
            if max(bx1, bx2) > min(ax1, ax2):   #矩形2最右端大于矩形最左端
                if max(ay1, ay2) > min(by1, by2):   #矩形1最高端大于矩形最低端
                    if max(by1, by2) > min(ay1, ay2): #矩形2最高端大于矩形最低端
                        return True
        return False
```
