public int Area() { return heaviside(x1 - x0) * heaviside(y1 - y0); }
/// <summary> /// Origin name: fraction_covered_by /// </summary> public float FractionCoveredBy(Rect other) { Rect isect = Intersection(other); int area = Area(); if (area > 0) { return(isect.Area() / (float)area); } else { return(-1); } }