From 49fbfa051c2b0778edccdc4fba2283639477f12f Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 6 May 2013 20:35:13 +0200 Subject: [PATCH] Optimized radians and degrees functions --- glm/core/func_trigonometric.inl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/glm/core/func_trigonometric.inl b/glm/core/func_trigonometric.inl index bd59cd73..0a545286 100644 --- a/glm/core/func_trigonometric.inl +++ b/glm/core/func_trigonometric.inl @@ -37,8 +37,7 @@ namespace glm { GLM_STATIC_ASSERT(detail::type::is_float, "'radians' only accept floating-point input"); - genType const pi = genType(3.1415926535897932384626433832795); - return degrees * (pi / genType(180)); + return degrees * genType(0.01745329251994329576923690768489); } VECTORIZE_VEC(radians) @@ -52,8 +51,7 @@ namespace glm { GLM_STATIC_ASSERT(detail::type::is_float, "'degrees' only accept floating-point input"); - const genType pi = genType(3.1415926535897932384626433832795); - return radians * (genType(180) / pi); + return radians * genType(57.295779513082320876798154814105); } VECTORIZE_VEC(degrees)