ADD: added M/S Knots conversion and correction functions for course and clb
This commit is contained in:
@@ -12,6 +12,8 @@
|
|||||||
namespace SimCore {
|
namespace SimCore {
|
||||||
|
|
||||||
|
|
||||||
|
#define __MS_TO_KNOTS__ 1.943844;
|
||||||
|
|
||||||
class UtilFunctions
|
class UtilFunctions
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -27,9 +29,20 @@ namespace SimCore {
|
|||||||
static double DegToRad(double deg);
|
static double DegToRad(double deg);
|
||||||
static double RadToDeg(double rad);
|
static double RadToDeg(double rad);
|
||||||
|
|
||||||
|
static double MSToKnots(double ms);
|
||||||
|
static double KnotsToMs(double knots);
|
||||||
|
|
||||||
|
|
||||||
|
static double ShiftRadCrs(double Rad);
|
||||||
|
static double ShiftRadClb(double Rad);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class AsyncWorker {
|
class AsyncWorker {
|
||||||
std::atomic<bool> active{true};
|
std::atomic<bool> active{true};
|
||||||
|
|
||||||
|
|||||||
@@ -103,4 +103,43 @@ namespace SimCore {
|
|||||||
return rad * 180 / M_PI;
|
return rad * 180 / M_PI;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double UtilFunctions::MSToKnots(double ms)
|
||||||
|
{
|
||||||
|
return ms * __MS_TO_KNOTS__;
|
||||||
|
}
|
||||||
|
double UtilFunctions::KnotsToMs(double knots)
|
||||||
|
{
|
||||||
|
return knots / __MS_TO_KNOTS__;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
double UtilFunctions::ShiftRadCrs(double Rad)
|
||||||
|
{
|
||||||
|
while(Rad < 0)
|
||||||
|
{
|
||||||
|
Rad += 2 * M_PI;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (Rad > 2 * M_PI)
|
||||||
|
{
|
||||||
|
Rad -= 2 * M_PI;
|
||||||
|
}
|
||||||
|
return Rad;
|
||||||
|
};
|
||||||
|
|
||||||
|
double UtilFunctions::ShiftRadClb(double Rad)
|
||||||
|
{
|
||||||
|
while(Rad < -M_PI)
|
||||||
|
{
|
||||||
|
Rad += 2 * M_PI;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (Rad > M_PI)
|
||||||
|
{
|
||||||
|
Rad -= 2 * M_PI;
|
||||||
|
}
|
||||||
|
return Rad;
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user