///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 – 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the “Software”), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtc_reciprocal
/// @file glm/gtc/reciprocal.inl
/// @date 2008-10-09 / 2012-04-07
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#include “../trigonometric.hpp” namespace glm template // csc template // cot genType const pi_over_2 = genType(3.1415926535897932384626433832795 / 2.0); template // asec template // acsc template // acot genType const pi_over_2 = genType(3.1415926535897932384626433832795 / 2.0); template // sech template // csch template // coth template // asech template // acsch template // acoth template
#include
{
// sec
template
GLM_FUNC_QUALIFIER genType sec(genType angle)
{
GLM_STATIC_ASSERT(std::numeric_limits
return genType(1) / glm::cos(angle);
}
GLM_FUNC_QUALIFIER vecType
{
GLM_STATIC_ASSERT(std::numeric_limits
return detail::functor1
}
template
GLM_FUNC_QUALIFIER genType csc(genType angle)
{
GLM_STATIC_ASSERT(std::numeric_limits
return genType(1) / glm::sin(angle);
}
GLM_FUNC_QUALIFIER vecType
{
GLM_STATIC_ASSERT(std::numeric_limits
return detail::functor1
}
template
GLM_FUNC_QUALIFIER genType cot(genType angle)
{
GLM_STATIC_ASSERT(std::numeric_limits
return glm::tan(pi_over_2 – angle);
}
GLM_FUNC_QUALIFIER vecType
{
GLM_STATIC_ASSERT(std::numeric_limits
return detail::functor1
}
template
GLM_FUNC_QUALIFIER genType asec(genType x)
{
GLM_STATIC_ASSERT(std::numeric_limits
return acos(genType(1) / x);
}
GLM_FUNC_QUALIFIER vecType
{
GLM_STATIC_ASSERT(std::numeric_limits
return detail::functor1
}
template
GLM_FUNC_QUALIFIER genType acsc(genType x)
{
GLM_STATIC_ASSERT(std::numeric_limits
return asin(genType(1) / x);
}
GLM_FUNC_QUALIFIER vecType
{
GLM_STATIC_ASSERT(std::numeric_limits
return detail::functor1
}
template
GLM_FUNC_QUALIFIER genType acot(genType x)
{
GLM_STATIC_ASSERT(std::numeric_limits
return pi_over_2 – atan(x);
}
GLM_FUNC_QUALIFIER vecType
{
GLM_STATIC_ASSERT(std::numeric_limits
return detail::functor1
}
template
GLM_FUNC_QUALIFIER genType sech(genType angle)
{
GLM_STATIC_ASSERT(std::numeric_limits
return genType(1) / glm::cosh(angle);
}
GLM_FUNC_QUALIFIER vecType
{
GLM_STATIC_ASSERT(std::numeric_limits
return detail::functor1
}
template
GLM_FUNC_QUALIFIER genType csch(genType angle)
{
GLM_STATIC_ASSERT(std::numeric_limits
return genType(1) / glm::sinh(angle);
}
GLM_FUNC_QUALIFIER vecType
{
GLM_STATIC_ASSERT(std::numeric_limits
return detail::functor1
}
template
GLM_FUNC_QUALIFIER genType coth(genType angle)
{
GLM_STATIC_ASSERT(std::numeric_limits
return glm::cosh(angle) / glm::sinh(angle);
}
GLM_FUNC_QUALIFIER vecType
{
GLM_STATIC_ASSERT(std::numeric_limits
return detail::functor1
}
template
GLM_FUNC_QUALIFIER genType asech(genType x)
{
GLM_STATIC_ASSERT(std::numeric_limits
return acosh(genType(1) / x);
}
GLM_FUNC_QUALIFIER vecType
{
GLM_STATIC_ASSERT(std::numeric_limits
return detail::functor1
}
template
GLM_FUNC_QUALIFIER genType acsch(genType x)
{
GLM_STATIC_ASSERT(std::numeric_limits
return acsch(genType(1) / x);
}
GLM_FUNC_QUALIFIER vecType
{
GLM_STATIC_ASSERT(std::numeric_limits
return detail::functor1
}
template
GLM_FUNC_QUALIFIER genType acoth(genType x)
{
GLM_STATIC_ASSERT(std::numeric_limits
return atanh(genType(1) / x);
}
GLM_FUNC_QUALIFIER vecType
{
GLM_STATIC_ASSERT(std::numeric_limits
return detail::functor1
}
}//namespace glm