7#include <AH/STL/type_traits>
13constexpr long double pi_inv_l = 0.318309886183790671537767526745028724L;
14constexpr long double pi_l = 3.141592653589793238462643383279502884L;
23 typename std::enable_if<std::is_floating_point<T>::value,
T>::type
25 return r *
static_cast<T>(detail::pi_inv_l) * 180;
30 typename std::enable_if<std::is_floating_point<T>::value, T>::type
32 return d *
static_cast<T>(detail::pi_l) / 180;
36constexpr long double operator"" _deg(
long double deg) {
return deg2rad(deg); }
38constexpr long double operator"" _deg(
unsigned long long deg) {
39 return deg2rad(
static_cast<long double>(deg));
#define BEGIN_AH_NAMESPACE
A class for serial-in/parallel-out shift registers, like the 74HC595 that are connected to the SPI bu...
constexpr std::enable_if< std::is_floating_point< T >::value, T >::type rad2deg(T r)
Convert radians to degrees.
constexpr std::enable_if< std::is_floating_point< T >::value, T >::type deg2rad(T d)
Convert degrees to radians.
constexpr long double pi_l
constexpr long double pi_inv_l