/// <summary> /// Compares two Size instances for fuzzy equality. This function /// helps compensate for the fact that double values can /// acquire error when operated upon /// </summary> /// <param name='size1'>The first size to compare</param> /// <param name='size2'>The second size to compare</param> /// <returns>Whether or not the two Size instances are equal</returns> public static bool AreClose(Size size1, Size size2) { return(DoubleUtil.AreClose(size1.Width, size2.Width) && DoubleUtil.AreClose(size1.Height, size2.Height)); }
/// <summary> /// Compares two Vector instances for fuzzy equality. This function /// helps compensate for the fact that double values can /// acquire error when operated upon /// </summary> /// <param name='vector1'>The first Vector to compare</param> /// <param name='vector2'>The second Vector to compare</param> /// <returns>Whether or not the two Vector instances are equal</returns> public static bool AreClose(Vector vector1, Vector vector2) { return(DoubleUtil.AreClose(vector1.X, vector2.X) && DoubleUtil.AreClose(vector1.Y, vector2.Y)); }
// The Point, Size, Rect and Matrix class have moved to WinCorLib. However, we provide // internal AreClose methods for our own use here. /// <summary> /// Compares two points for fuzzy equality. This function /// helps compensate for the fact that double values can /// acquire error when operated upon /// </summary> /// <param name='point1'>The first point to compare</param> /// <param name='point2'>The second point to compare</param> /// <returns>Whether or not the two points are equal</returns> public static bool AreClose(Point point1, Point point2) { return(DoubleUtil.AreClose(point1.X, point2.X) && DoubleUtil.AreClose(point1.Y, point2.Y)); }