18 #ifndef POINTS_PREPROCESSOR_RAY_GROUND_FILTER__ATAN2_UTILS_H
19 #define POINTS_PREPROCESSOR_RAY_GROUND_FILTER__ATAN2_UTILS_H
24 constexpr
float PI = 3.14159265359F;
26 constexpr
float PI_2 = 1.5707963267948966F;
48 constexpr
float scaling_constant = 0.28086f;
57 return ::std::copysign(
PI_2, y);
65 if (fabsf(div) < 1.0
f) {
68 float atan = div / (1.0f + scaling_constant * div * div);
72 return ::std::copysign(
PI, y) + atan;
78 return ::std::copysign(
PI_2, y) - div / (div * div + scaling_constant);
83 #endif // POINTS_PREPROCESSOR_RAY_GROUND_FILTER__ATAN2_UTILS_H