Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
5.4KB

  1. /// @ref core
  2. /// @file glm/exponential.hpp
  3. ///
  4. /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
  5. ///
  6. /// @defgroup core_func_exponential Exponential functions
  7. /// @ingroup core
  8. ///
  9. /// Include <glm/exponential.hpp> to use these core features.
  10. ///
  11. /// These all operate component-wise. The description is per component.
  12. #pragma once
  13. #include "detail/type_vec1.hpp"
  14. #include "detail/type_vec2.hpp"
  15. #include "detail/type_vec3.hpp"
  16. #include "detail/type_vec4.hpp"
  17. #include <cmath>
  18. namespace glm
  19. {
  20. /// @addtogroup core_func_exponential
  21. /// @{
  22. /// Returns 'base' raised to the power 'exponent'.
  23. ///
  24. /// @param base Floating point value. pow function is defined for input values of 'base' defined in the range (inf-, inf+) in the limit of the type qualifier.
  25. /// @param exponent Floating point value representing the 'exponent'.
  26. ///
  27. /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/pow.xml">GLSL pow man page</a>
  28. /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
  29. template<length_t L, typename T, qualifier Q>
  30. GLM_FUNC_DECL vec<L, T, Q> pow(vec<L, T, Q> const& base, vec<L, T, Q> const& exponent);
  31. /// Returns the natural exponentiation of x, i.e., e^x.
  32. ///
  33. /// @param v exp function is defined for input values of v defined in the range (inf-, inf+) in the limit of the type qualifier.
  34. /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector.
  35. /// @tparam T Floating-point scalar types.
  36. ///
  37. /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp.xml">GLSL exp man page</a>
  38. /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
  39. template<length_t L, typename T, qualifier Q>
  40. GLM_FUNC_DECL vec<L, T, Q> exp(vec<L, T, Q> const& v);
  41. /// Returns the natural logarithm of v, i.e.,
  42. /// returns the value y which satisfies the equation x = e^y.
  43. /// Results are undefined if v <= 0.
  44. ///
  45. /// @param v log function is defined for input values of v defined in the range (0, inf+) in the limit of the type qualifier.
  46. /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector.
  47. /// @tparam T Floating-point scalar types.
  48. ///
  49. /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log.xml">GLSL log man page</a>
  50. /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
  51. template<length_t L, typename T, qualifier Q>
  52. GLM_FUNC_DECL vec<L, T, Q> log(vec<L, T, Q> const& v);
  53. /// Returns 2 raised to the v power.
  54. ///
  55. /// @param v exp2 function is defined for input values of v defined in the range (inf-, inf+) in the limit of the type qualifier.
  56. /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector.
  57. /// @tparam T Floating-point scalar types.
  58. ///
  59. /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp2.xml">GLSL exp2 man page</a>
  60. /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
  61. template<length_t L, typename T, qualifier Q>
  62. GLM_FUNC_DECL vec<L, T, Q> exp2(vec<L, T, Q> const& v);
  63. /// Returns the base 2 log of x, i.e., returns the value y,
  64. /// which satisfies the equation x = 2 ^ y.
  65. ///
  66. /// @param v log2 function is defined for input values of v defined in the range (0, inf+) in the limit of the type qualifier.
  67. /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector.
  68. /// @tparam T Floating-point scalar types.
  69. ///
  70. /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log2.xml">GLSL log2 man page</a>
  71. /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
  72. template<length_t L, typename T, qualifier Q>
  73. GLM_FUNC_DECL vec<L, T, Q> log2(vec<L, T, Q> const& v);
  74. /// Returns the positive square root of v.
  75. ///
  76. /// @param v sqrt function is defined for input values of v defined in the range [0, inf+) in the limit of the type qualifier.
  77. /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector.
  78. /// @tparam T Floating-point scalar types.
  79. ///
  80. /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sqrt.xml">GLSL sqrt man page</a>
  81. /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
  82. template<length_t L, typename T, qualifier Q>
  83. GLM_FUNC_DECL vec<L, T, Q> sqrt(vec<L, T, Q> const& v);
  84. /// Returns the reciprocal of the positive square root of v.
  85. ///
  86. /// @param v inversesqrt function is defined for input values of v defined in the range [0, inf+) in the limit of the type qualifier.
  87. /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector.
  88. /// @tparam T Floating-point scalar types.
  89. ///
  90. /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inversesqrt.xml">GLSL inversesqrt man page</a>
  91. /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
  92. template<length_t L, typename T, qualifier Q>
  93. GLM_FUNC_DECL vec<L, T, Q> inversesqrt(vec<L, T, Q> const& v);
  94. /// @}
  95. }//namespace glm
  96. #include "detail/func_exponential.inl"