mirror of
https://github.com/g-truc/glm.git
synced 2025-04-07 06:25:00 +00:00
implement cot as tan(pi/2 - angle)
This commit is contained in:
parent
7def337781
commit
e637299192
1 changed files with 3 additions and 1 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue