Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00008
00009 #include "MathToolbox.hpp"
00010 #include <limits>
00011
00012
00013 const double NaN_double = std::numeric_limits<double>::quiet_NaN();
00014
00015
00019 double hypot(double x, double y, double z)
00020 {
00021 return sqrt(x*x + y*y + z*z);
00022 }
00023
00024
00031 double normalizeRadians (double radians)
00032 {
00033 if (std::abs(radians) > PI)
00034 {
00035
00036
00037
00038 radians = std::atan2 (std::sin(radians), std::cos(radians));
00039
00040 }
00041 if (radians == PI)
00042 {
00043
00044 radians = -PI;
00045 }
00046 return radians;
00047 }