Add deg<->rag conversions

This commit is contained in:
Nikita Lisitsa 2020-09-13 16:38:50 +03:00
parent c7dba5eef2
commit 66f9878dd1

View file

@ -5,4 +5,16 @@ 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);
}
}