public static long CalculateOverLapArea(Rectangle2DPlane rectangle1, Rectangle2DPlane rectangle2) { long Area = 0; int xDistance = CalculateOverlapDistance(rectangle1.Bottom.X, rectangle1.Top.X, rectangle2.Bottom.X, rectangle2.Top.X); if (xDistance < 0) { return(0); } int yDistance = CalculateOverlapDistance(rectangle1.Bottom.Y, rectangle1.Top.Y, rectangle2.Bottom.Y, rectangle2.Top.Y); if (yDistance < 0) { return(0); } Area = xDistance * yDistance; return(Area); }
public static long CalculateOverLapArea(Rectangle2DPlane rectangle1, Rectangle2DPlane rectangle2) { return(GeometryPuzzles.CalculateOverLapArea(rectangle1, rectangle2)); }