coord: relax restrictions on is_normalised

This commit is contained in:
Danny Robson 2018-04-18 21:43:40 +10:00
parent 8a2055abfc
commit fe88708c50

View File

@ -818,7 +818,12 @@ namespace util {
bool
is_normalised (const K &k)
{
return almost_equal (norm2 (k), typename K::value_type{1});
using value_type = typename K::value_type;
constexpr auto hi = value_type (1.00001);
constexpr auto lo = value_type (0.99999);
const auto n2 = norm2 (k);
return n2 < hi && n2 > lo;
}