示例#1
0
 /// <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(System.Windows.Vector vector1, System.Windows.Vector vector2)
 {
     return(DoubleUtil.AreClose(vector1.X, vector2.X) &&
            DoubleUtil.AreClose(vector1.Y, vector2.Y));
 }
示例#2
0
        // 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 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));
        }