13 namespace HybridAStar {
25 static inline float normalizeHeading(
float t) {
26 if ((
int)t <= 0 || (
int)t >= 360) {
29 }
else if ((
int)t >= 360) {
44 static inline float normalizeHeadingRad(
float t) {
46 t = t - 2.f * M_PI * (int)(t / (2.f * M_PI));
47 return 2.f * M_PI + t;
50 return t - 2.f * M_PI * (int)(t / (2.f * M_PI));
58 static inline float toDeg(
float t) {
59 return normalizeHeadingRad(t) * 180.f / M_PI ;
67 static inline float toRad(
float t) {
68 return normalizeHeadingRad(t / 180.f * M_PI);
76 static inline float clamp(
float n,
float lower,
float upper) {
77 return std::max(lower, std::min(n, upper));
This is a collection of constants that are used throughout the project.