ADD: added conversion from degree to rad

This commit is contained in:
Henry Winkel
2023-03-28 14:00:20 +02:00
parent 76ff5c6bac
commit e75337bfbb
2 changed files with 15 additions and 0 deletions

View File

@@ -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);
};

View File

@@ -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;
}
}