somehow managed to implement rotation cleanly
This commit is contained in:
1 parent
b6e7ab8aa4
commit
b95417293b
4 files changed
+77
-49
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user