矩形交
x=max(min(x1,x2),min(x3,x4));找左下x,即单个矩阵x最小取max
y=max(min(y1,y2),min(y3,y4));找左下y,即单个矩阵y最小取max
xx=min(max(x1,x2),max(x3,x4));找右上x,即单个矩阵x最大取min
yy=min(max(y1,y2),max(y3,y4));找右上y,即单个矩阵y最大取min
线段交
x=max(x1,x2);
y=min(y1,y2);