Example #1
0
            /// <summary>True if 'lhs' and 'rhs' are very similar</summary>
            public static bool ApproxEqual(NavHistoryRecord lhs, NavHistoryRecord rhs)
            {
                // Use a tolerance of 1% of the smallest range
                var tol = 0.01 * Math.Min(Math.Min(lhs.XRange.Size, lhs.YRange.Size), Math.Min(rhs.XRange.Size, rhs.YRange.Size));

                return
                    (Math_.FEqlAbsolute(lhs.XRange.Beg, rhs.XRange.Beg, tol) &&
                     Math_.FEqlAbsolute(lhs.XRange.End, rhs.XRange.End, tol) &&
                     Math_.FEqlAbsolute(lhs.YRange.Beg, rhs.YRange.Beg, tol) &&
                     Math_.FEqlAbsolute(lhs.YRange.End, rhs.YRange.End, tol));
            }