public RectangleE Union(PointE pt) { if (Contains(pt)) { return(CloneRect()); } IntervalE xInt = XInterval.Union(pt.X); RectangleE ans = new RectangleE(xInt, YInterval.Union(pt.Y)); return(ans); }
public RectangleE Union(RectangleE r) { if (r.Height == 0 || r.Width == 0) { return(CloneRect()); } if (Height == 0 || Width == 0) { return(r.CloneRect()); } return(new RectangleE(XInterval.Union(r.XInterval), YInterval.Union(r.YInterval))); }