[Positioner] Add PosUtil::deg2rad()

This commit is contained in:
Matteo Cypriani 2012-04-30 09:55:32 +02:00
parent 90fc329f82
commit 88a90a7abd
2 changed files with 9 additions and 1 deletions

View File

@ -23,6 +23,12 @@ using std::tr1::unordered_map ;
/* *** Maths *** */
double PosUtil::deg2rad(const double &degrees)
{
return degrees / (180.0 / M_PI) ;
}
double PosUtil::rad2deg(const double &radians)
{
return radians * (180.0 / M_PI) ;

View File

@ -22,7 +22,9 @@ public:
/** @name Maths */
//@{
/// Return the degree value of \em radians
/// Returns the radian value of \em degrees
static double deg2rad(const double &degrees) ;
/// Returns the degree value of \em radians
static double rad2deg(const double &radians) ;
/// Checks if \em value is in the interval [center-width;center+width]
static bool is_in_interval(float center, float bound, float value) ;