1 つのアルゴリズムに問題があります。2 つの長方形 (どちらも OX と OY に平行) の交点の面積を計算するとします。長方形 (A と呼びましょう) は (x1,y1,x2,y2) 左上隅 (x1,y1) と右下隅 (x2,y2) で表され、秒は B (x3,y3,x4, y4)。1つのアルゴリズムについて考えましたが、不十分なようです。
if(all of the points of rectangle A are inside of rectangle B)
calculate(A);
else if(all of points the points of rectangle B are in A)
calculate(B);
else if(x1 y1 is inside rectangle B)
if(x1 is on the left from x3){
if(y1 is under the y3)
else
}
などなど、とても長くてばかげています。