ADD: added conversion from degree to rad
This commit is contained in:
@@ -20,6 +20,8 @@ namespace SimCore {
|
||||
static void check_host_entry(struct hostent * hostentry);
|
||||
static void IP_formatter(char *IPbuffer);
|
||||
static std::string getOwnIP();
|
||||
static double DegToRad(double deg);
|
||||
static double RadToDeg(double rad);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <SimCore/UtilFunctions.hpp>
|
||||
#include <arpa/inet.h>
|
||||
#include <cmath>
|
||||
#include <netdb.h>
|
||||
#include <string>
|
||||
#include <unistd.h>
|
||||
@@ -77,4 +78,16 @@ namespace SimCore {
|
||||
return IP;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
double UtilFunctions::DegToRad(double deg)
|
||||
{
|
||||
return deg * M_PI / 180.0;
|
||||
}
|
||||
double UtilFunctions::RadToDeg(double rad)
|
||||
{
|
||||
return rad * 180 / M_PI;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user