huge commit
- worked on about everything - grid walker using plugable modules - wifi models - new distributions - worked on geometric data-structures - added typesafe timestamps - worked on grid-building - added sensor-classes - added sensor analysis (step-detection, turn-detection) - offline data reader - many test-cases
This commit is contained in:
12
geo/Angle.h
12
geo/Angle.h
@@ -40,6 +40,18 @@ public:
|
||||
return (tmp <= M_PI) ? (tmp) : (2*M_PI-tmp);
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the angular difference between
|
||||
* - the given radians [0:2PI]
|
||||
* - as a change-in-direction between [-PI:+PI]
|
||||
*/
|
||||
static float getSignedDiffRAD_2PI(const float r1, const float r2) {
|
||||
Assert::isBetween(r1, 0.0f, (float)(2*M_PI), "r1 out of bounds");
|
||||
Assert::isBetween(r2, 0.0f, (float)(2*M_PI), "r2 out of bounds");
|
||||
const float a1 = (r2-r1);
|
||||
if (std::abs(a1) < M_PI) {return a1;} else {return (M_PI-a1);}
|
||||
}
|
||||
|
||||
/** convert degrees to radians */
|
||||
static constexpr float degToRad(const float deg) {
|
||||
return deg / 180.0f * M_PI;
|
||||
|
||||
Reference in New Issue
Block a user