Move deg, rad to math.hpp

This commit is contained in:
Nikita Lisitsa 2020-09-29 19:16:09 +03:00
parent 2b57e3e696
commit ebcd2906a8
2 changed files with 14 additions and 12 deletions

View file

@ -5,16 +5,4 @@ namespace psemek::geom
constexpr long double pi = 3.141592653589793238462643383279502884l;
template <typename T>
T deg(T x)
{
return static_cast<T>((180 * x) / pi);
}
template <typename T>
T rad(T x)
{
return static_cast<T>((x * pi) / 180);
}
}

View file

@ -1,5 +1,7 @@
#pragma once
#include <psemek/geom/constants.hpp>
namespace psemek::geom
{
@ -9,4 +11,16 @@ namespace psemek::geom
return x * x;
}
template <typename T>
T deg(T x)
{
return static_cast<T>((180 * x) / pi);
}
template <typename T>
T rad(T x)
{
return static_cast<T>((x * pi) / 180);
}
}