function rectRect(ax,ay,aw,ah,bx,by,bw,bh){
return ax<=bx+bw&&ax+aw>=bx&&ay<=by+bh&&ay+ah>=by;
}function rectRect(x0,y0,x1,y1,x2,y2,x3,y3){
return x0<=x3&&x1>=x2&&y0<=y3&&y1>=y2;
}const{min,max}=Math;
function rectRect(...p){
for(let i of[0,1,4,5])[p[i],p[i+2]]=[min(p[i],p[i+2]),max(p[i],p[i+2])];
const[x0,y0,x1,y1,x2,y2,x3,y3]=p;
return x0<=x3&&x1>=x2&&y0<=y3&&y1>=y2;
} const{min,max}=Math;
function rectRect(x0,y0,x1,y1,x2,y2,x3,y3){
return max(0,min(x1,x3)-max(x0,x2))>0&&max(0,min(y1,y3)-max(y0,y2))>0;
} function rectRect(x0,y0,x1,y1,x2,y2,x3,y3){
return!(x0>=x3||x2>=x1||y0>=y3||y2>=y1);
}Start a new topic to continue this conversation.
Or browse the latest topics.