Skip to content

Commit

Permalink
Merge pull request #272 from plasmacel/master
Browse files Browse the repository at this point in the history
optimized cot function implementation #272
  • Loading branch information
Groovounet committed Nov 21, 2014
2 parents afd58dc + 7e3dc0a commit b944e3a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion glm/gtc/reciprocal.inl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ namespace glm
GLM_FUNC_QUALIFIER genType cot(genType angle)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'cot' only accept floating-point values");
return genType(1) / glm::tan(angle);

genType const pi_over_2 = genType(3.1415926535897932384626433832795 / 2.0);
return glm::tan(pi_over_2 - angle);
}

template <typename T, precision P, template <typename, precision> class vecType>
Expand Down

0 comments on commit b944e3a

Please sign in to comment.