somehow managed to implement rotation cleanly
This commit is contained in:
@@ -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