somehow managed to implement rotation cleanly

This commit is contained in:
Pavel Lutskov
2019-01-29 17:31:52 +01:00
parent b6e7ab8aa4
commit b95417293b
4 changed files with 77 additions and 49 deletions

View File

@@ -1,14 +1,27 @@
#ifndef _UTILS_HPP_
#define _UTILS_HPP_
#define PI 3.14159265358979323846
#include <sstream>
namespace {
template<typename T> inline std::string stuff_to_str(T i) {
std::ostringstream ss;
ss << i;
return ss.str();
}
double radians(double degrees) {
return degrees / 180 * PI;
}
double degrees(double radians) {
return radians / PI * 180;
}
}
#endif