Limit convolution processing to the output ambisonic order
[openal-soft.git] / common / math_defs.h
blobd90eaae57bdc47fb825a11c1f8b46e8c262f64e7
1 #ifndef AL_MATH_DEFS_H
2 #define AL_MATH_DEFS_H
4 #include <math.h>
6 constexpr inline float Deg2Rad(float x) noexcept { return x * 1.74532925199432955e-02f/*pi/180*/; }
7 constexpr inline float Rad2Deg(float x) noexcept { return x * 5.72957795130823229e+01f/*180/pi*/; }
9 namespace al {
11 template<typename Real>
12 struct MathDefs { };
14 template<>
15 struct MathDefs<float> {
16 static constexpr inline float Pi() noexcept { return 3.14159265358979323846e+00f; }
17 static constexpr inline float Tau() noexcept { return 6.28318530717958647692e+00f; }
20 template<>
21 struct MathDefs<double> {
22 static constexpr inline double Pi() noexcept { return 3.14159265358979323846e+00; }
23 static constexpr inline double Tau() noexcept { return 6.28318530717958647692e+00; }
26 } // namespace al
28 #endif /* AL_MATH_DEFS_H */