Reorg util/math -> math.
This commit is contained in:
52
src/math.cc
Normal file
52
src/math.cc
Normal file
@@ -0,0 +1,52 @@
|
||||
#include <wrmath/math.h>
|
||||
|
||||
|
||||
namespace wr {
|
||||
namespace math {
|
||||
|
||||
|
||||
float
|
||||
RadiansToDegreesF(float rads)
|
||||
{
|
||||
return rads * (180.0 / M_PI);
|
||||
}
|
||||
|
||||
|
||||
double
|
||||
RadiansToDegreesD(double rads)
|
||||
{
|
||||
return rads * (180.0 / M_PI);
|
||||
}
|
||||
|
||||
|
||||
float
|
||||
DegreesToRadiansF(float degrees)
|
||||
{
|
||||
return degrees * M_PI / 180.0;
|
||||
}
|
||||
|
||||
|
||||
double
|
||||
DegreesToRadiansD(double degrees)
|
||||
{
|
||||
return degrees * M_PI / 180.0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DefaultEpsilon(double &epsilon)
|
||||
{
|
||||
epsilon = Epsilon_double;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DefaultEpsilon(float &epsilon)
|
||||
{
|
||||
epsilon = Epsilon_float;
|
||||
}
|
||||
|
||||
|
||||
} // namespace math
|
||||
} // namespace wr
|
||||
|
||||
@@ -6,34 +6,6 @@ namespace wr {
|
||||
namespace geom {
|
||||
|
||||
|
||||
float
|
||||
RadiansToDegreesF(float rads)
|
||||
{
|
||||
return rads * (180.0 / M_PI);
|
||||
}
|
||||
|
||||
|
||||
double
|
||||
RadiansToDegreesD(double rads)
|
||||
{
|
||||
return rads * (180.0 / M_PI);
|
||||
}
|
||||
|
||||
|
||||
float
|
||||
DegreesToRadiansF(float degrees)
|
||||
{
|
||||
return degrees * M_PI / 180.0;
|
||||
}
|
||||
|
||||
|
||||
double
|
||||
DegreesToRadiansD(double degrees)
|
||||
{return degrees * M_PI / 180.0;
|
||||
return degrees * M_PI / 180.0;
|
||||
}
|
||||
|
||||
|
||||
float
|
||||
Heading2f(Vector2f vec)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user