27 #ifndef G2O_STUFF_MISC_H 28 #define G2O_STUFF_MISC_H 34 #define M_PI 3.14159265358979323846 63 return (T) (sqrt(x*x + y*y));
80 return degree * 0.01745329251994329576;
88 return rad * 57.29577951308232087721;
99 double multiplier = floor(theta / (2*
M_PI));
100 theta = theta - multiplier*2*
M_PI;
124 x = cos(theta1) + cos(theta2);
125 y = sin(theta1) + sin(theta2);
129 return std::atan2(y, x);
136 template <
typename T>
150 template <
typename T>
163 template <
typename T>
166 T intervalWidth = u - l;
177 inline bool arrayHasNaN(
const double* array,
int size,
int* nanIndex = 0)
179 for (
int i = 0; i < size; ++i)
void(* ForceLinkFunction)(void)
double deg2rad(double degree)
double average_angle(double theta1, double theta2)
TFSIMD_FORCE_INLINE const tfScalar & y() const
bool arrayHasNaN(const double *array, int size, int *nanIndex=0)
double rad2deg(double rad)
TFSIMD_FORCE_INLINE const tfScalar & x() const
double normalize_theta(double theta)
ForceLinker(ForceLinkFunction function)
double inverse_theta(double th)