20 #ifndef ANTKEEPER_MATH_NUMBERS_HPP
21 #define ANTKEEPER_MATH_NUMBERS_HPP
33 inline constexpr T
inf = std::numeric_limits<T>::infinity();
37 inline constexpr T
e = std::numbers::e_v<T>;
41 inline constexpr T
log2_e = std::numbers::log2e_v<T>;
45 inline constexpr T
log10_e = std::numbers::log10e_v<T>;
49 inline constexpr T
pi = std::numbers::pi_v<T>;
53 inline constexpr T
two_pi = pi<T> * T{2};
57 inline constexpr T
four_pi = pi<T> * T{4};
61 inline constexpr T
half_pi = pi<T> / T{2};
65 inline constexpr T
inv_pi = std::numbers::inv_pi_v<T>;
69 inline constexpr T
inv_sqrt_pi = std::numbers::inv_sqrtpi_v<T>;
73 inline constexpr T
sqr_pi = std::numbers::pi_v<T> * std::numbers::pi_v<T>;
77 inline constexpr T
ln_2 = std::numbers::ln2_v<T>;
81 inline constexpr T
ln_10 = std::numbers::ln10_v<T>;
85 inline constexpr T
sqrt_half = T{0.70710678118654752440084436210485};
89 inline constexpr T
sqrt_2 = std::numbers::sqrt2_v<T>;
93 inline constexpr T
sqrt_3 = std::numbers::sqrt3_v<T>;
97 inline constexpr T
inv_sqrt_3 = std::numbers::inv_sqrt3_v<T>;
101 inline constexpr T
sqrt_5 = T{2.2360679774997896964091736687313};
105 inline constexpr T
egamma = std::numbers::egamma_v<T>;
109 inline constexpr T
phi = std::numbers::phi_v<T>;
122 using namespace numbers;
constexpr T sqrt_2
sqrt(2)
constexpr T egamma
Euler–Mascheroni constant.
constexpr T sqrt_half
sqrt(0.5)
constexpr T inv_pi
1 / Pi.
constexpr T inv_sqrt_pi
1 / sqrt(Pi).
constexpr T inf
Positive infinity.
constexpr T phi
Golden ratio constant.
constexpr T log10_e
log10(e).
constexpr T rad2deg
Radians-to-degrees conversion factor.
constexpr T inv_sqrt_3
1 / sqrt(3)
constexpr T four_pi
Pi * 4.
constexpr T half_pi
Pi / 2.
constexpr T log2_e
log2(e).
constexpr T two_pi
Pi * 2.
constexpr T sqrt_5
sqrt(5)
constexpr T deg2rad
Degrees-to-radians conversion factor.
constexpr T sqrt_3
sqrt(3)
Mathematical functions and data types.