public static bool RectHasNaN(Rectangle r)
 {
     return(DoubleUtil.IsNaN(r.X) || DoubleUtil.IsNaN(r.Y) || (DoubleUtil.IsNaN(r.Height) || DoubleUtil.IsNaN(r.Width)));
 }
 public static bool AreClose(Rectangle rect1, Rectangle rect2)
 {
     if (rect1.IsEmpty)
     {
         return(rect2.IsEmpty);
     }
     if (!rect2.IsEmpty && DoubleUtil.AreClose(rect1.X, rect2.X) && (DoubleUtil.AreClose(rect1.Y, rect2.Y) && DoubleUtil.AreClose(rect1.Height, rect2.Height)))
     {
         return(DoubleUtil.AreClose(rect1.Width, rect2.Width));
     }
     return(false);
 }