added several grid-walks
added new helper methods/classes (e.g. for heading) new test cases optimize the dijkstra cleanups/refactoring added timed-benchmarks to the log many more...
This commit is contained in:
10
geo/Angle.h
10
geo/Angle.h
@@ -4,7 +4,8 @@
|
||||
#include <cmath>
|
||||
#include <KLib/Assertions.h>
|
||||
|
||||
class Angle {
|
||||
struct Angle {
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@@ -28,12 +29,15 @@ public:
|
||||
static float getDiffRAD_2PI_PI(const float r1, const float r2) {
|
||||
_assertBetween(r1, 0, 2*M_PI, "r1 out of bounds");
|
||||
_assertBetween(r2, 0, 2*M_PI, "r2 out of bounds");
|
||||
return fmod(std::abs(r2 - r1), M_PI);
|
||||
float tmp = std::abs(r1-r2);
|
||||
return (tmp <= M_PI) ? (tmp) : (2*M_PI-tmp);
|
||||
//float tmp2 = fmod(tmp, M_PI);
|
||||
//return fmod(std::abs(r2 - r1), M_PI);
|
||||
|
||||
}
|
||||
|
||||
/** convert degrees to radians */
|
||||
static float degToRad(const float deg) {
|
||||
static constexpr float degToRad(const float deg) {
|
||||
return deg / 180 * M_PI;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user