Add to/from radian helpers
This commit is contained in:
parent
bd12deed4e
commit
16d05e9ea6
13
maths.hpp
13
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 <>
|
template <>
|
||||||
bool
|
bool
|
||||||
almost_equal (const float &a, const float &b);
|
almost_equal (const float &a, const float &b);
|
||||||
|
Loading…
Reference in New Issue
Block a user