From f08fb7293382dbaf240860119d128486ada62221 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sat, 21 Oct 2017 14:40:20 +0200 Subject: Improve short paths and do some refactoring. --- src/math.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/math.hpp') diff --git a/src/math.hpp b/src/math.hpp index f3b049b..55bf438 100644 --- a/src/math.hpp +++ b/src/math.hpp @@ -193,6 +193,12 @@ public: return std::sqrt(*this * *this); } + T angle(void) + { + static_assert(N == 2, "angle called for a vector that's not 2-dimensional"); + return atan2(v[1], v[0]); + } + // Compatibility with SFML template -- cgit