diff options
Diffstat (limited to 'include/mbgl/util/math.hpp')
-rw-r--r-- | include/mbgl/util/math.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/mbgl/util/math.hpp b/include/mbgl/util/math.hpp index 9be0568e12..08625ffc0c 100644 --- a/include/mbgl/util/math.hpp +++ b/include/mbgl/util/math.hpp @@ -88,6 +88,11 @@ inline T dist(const S1& a, const S2& b) { } template <typename T> +inline T round(const T& a) { + return T(::round(a.x), ::round(a.y)); +} + +template <typename T> inline T length(T a, T b) { return std::sqrt(a * a + b * b); } |