Add deg<->rag conversions
This commit is contained in:
parent
c7dba5eef2
commit
66f9878dd1
1 changed files with 12 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue