Add tau constant ##1153

This commit is contained in:
christophe 2023-12-21 12:05:02 +01:00 committed by Christophe
parent 08f2fd1099
commit 85f2e6b998
2 changed files with 11 additions and 0 deletions

View File

@ -39,6 +39,11 @@ namespace glm
template<typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType two_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType two_pi();
/// Return unit-circle circumference, or pi * 2.
/// @see gtc_constants
template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType tau() { return glm::two_pi<genType>(); }
/// Return square root of pi. /// Return square root of pi.
/// @see gtc_constants /// @see gtc_constants
template<typename genType> template<typename genType>

View File

@ -20,6 +20,12 @@ namespace glm
return genType(6.28318530717958647692528676655900576); return genType(6.28318530717958647692528676655900576);
} }
template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType tau()
{
return two_pi<genType>();
}
template<typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_pi()
{ {