diff --git a/maths.hpp b/maths.hpp index 70999349..336b5f17 100644 --- a/maths.hpp +++ b/maths.hpp @@ -69,6 +69,19 @@ almost_equal (const Ta &a, const Tb &b) { } +const double PI = 3.141592653589793238462643; + +inline double +to_degreees (double radians) { + return radians * 180 / PI; +} + +inline double +to_radians (double degrees) { + return degrees / 180 * PI; +} + + template <> bool almost_equal (const float &a, const float &b);