/// @ref ext_vector_reciprocal #include "../trigonometric.hpp" #include namespace glm { // sec template GLM_FUNC_QUALIFIER vec sec(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'sec' only accept floating-point inputs"); return static_cast(1) / detail::functor1::call(cos, x); } // csc template GLM_FUNC_QUALIFIER vec csc(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'csc' only accept floating-point inputs"); return static_cast(1) / detail::functor1::call(sin, x); } // cot template GLM_FUNC_QUALIFIER vec cot(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'cot' only accept floating-point inputs"); T const pi_over_2 = static_cast(3.1415926535897932384626433832795 / 2.0); return detail::functor1::call(tan, pi_over_2 - x); } // asec template GLM_FUNC_QUALIFIER vec asec(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'asec' only accept floating-point inputs"); return detail::functor1::call(acos, static_cast(1) / x); } // acsc template GLM_FUNC_QUALIFIER vec acsc(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acsc' only accept floating-point inputs"); return detail::functor1::call(asin, static_cast(1) / x); } // acot template GLM_FUNC_QUALIFIER vec acot(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acot' only accept floating-point inputs"); T const pi_over_2 = static_cast(3.1415926535897932384626433832795 / 2.0); return pi_over_2 - detail::functor1::call(atan, x); } // sech template GLM_FUNC_QUALIFIER vec sech(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'sech' only accept floating-point inputs"); return static_cast(1) / detail::functor1::call(cosh, x); } // csch template GLM_FUNC_QUALIFIER vec csch(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'csch' only accept floating-point inputs"); return static_cast(1) / detail::functor1::call(sinh, x); } // coth template GLM_FUNC_QUALIFIER vec coth(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'coth' only accept floating-point inputs"); return glm::cosh(x) / glm::sinh(x); } // asech template GLM_FUNC_QUALIFIER vec asech(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'asech' only accept floating-point inputs"); return detail::functor1::call(acosh, static_cast(1) / x); } // acsch template GLM_FUNC_QUALIFIER vec acsch(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acsch' only accept floating-point inputs"); return detail::functor1::call(asinh, static_cast(1) / x); } // acoth template GLM_FUNC_QUALIFIER vec acoth(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acoth' only accept floating-point inputs"); return detail::functor1::call(atanh, static_cast(1) / x); } }//namespace glm