diff options
author | Chris Robinson <[email protected]> | 2019-09-20 13:35:29 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-09-20 13:35:29 -0700 |
commit | 65eb0987e2f08655575f4d835e178b483901a053 (patch) | |
tree | e162dec1df7757bf35ffa266912a9651273d47aa /common | |
parent | 79a621ac47e01ad886bc7b4284e514d736650e6d (diff) |
Remove and simplify some functions
Diffstat (limited to 'common')
-rw-r--r-- | common/math_defs.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/common/math_defs.h b/common/math_defs.h index 9749bd53..0362a956 100644 --- a/common/math_defs.h +++ b/common/math_defs.h @@ -17,16 +17,14 @@ struct MathDefs { }; template<> struct MathDefs<float> { - static constexpr inline float Pi() noexcept { return 3.14159265358979323846f; } - static constexpr inline float Tau() noexcept { return 3.14159265358979323846f * 2.0f; } - static constexpr inline float Sqrt3() noexcept { return 1.73205080756887719318f; } + static constexpr inline float Pi() noexcept { return static_cast<float>(M_PI); } + static constexpr inline float Tau() noexcept { return static_cast<float>(M_PI * 2.0); } }; template<> struct MathDefs<double> { - static constexpr inline double Pi() noexcept { return 3.14159265358979323846; } - static constexpr inline double Tau() noexcept { return 3.14159265358979323846 * 2.0; } - static constexpr inline double Sqrt3() noexcept { return 1.73205080756887719318; } + static constexpr inline double Pi() noexcept { return M_PI; } + static constexpr inline double Tau() noexcept { return M_PI * 2.0; } }; } // namespace al |