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.

123 lines
6.2 KiB

5 years ago
  1. ///////////////////////////////////////////////////////////////////////////////////
  2. /// OpenGL Mathematics (glm.g-truc.net)
  3. ///
  4. /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
  5. /// Permission is hereby granted, free of charge, to any person obtaining a copy
  6. /// of this software and associated documentation files (the "Software"), to deal
  7. /// in the Software without restriction, including without limitation the rights
  8. /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. /// copies of the Software, and to permit persons to whom the Software is
  10. /// furnished to do so, subject to the following conditions:
  11. ///
  12. /// The above copyright notice and this permission notice shall be included in
  13. /// all copies or substantial portions of the Software.
  14. ///
  15. /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21. /// THE SOFTWARE.
  22. ///
  23. /// @ref core
  24. /// @file glm/core/func_exponential.hpp
  25. /// @date 2008-08-08 / 2011-06-14
  26. /// @author Christophe Riccio
  27. ///
  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. ///
  30. /// @defgroup core_func_exponential Exponential functions
  31. /// @ingroup core
  32. ///
  33. /// These all operate component-wise. The description is per component.
  34. ///////////////////////////////////////////////////////////////////////////////////
  35. #ifndef glm_core_func_exponential
  36. #define glm_core_func_exponential GLM_VERSION
  37. namespace glm
  38. {
  39. /// @addtogroup core_func_exponential
  40. /// @{
  41. /// Returns 'base' raised to the power 'exponent'.
  42. ///
  43. /// @param base Floating point value. pow function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision.
  44. /// @param exponent Floating point value representing the 'exponent'.
  45. /// @tparam genType Floating-point scalar or vector types.
  46. ///
  47. /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/pow.xml">GLSL pow man page</a>
  48. /// @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>
  49. template <typename genType>
  50. GLM_FUNC_DECL genType pow(genType const & base, genType const & exponent);
  51. /// Returns the natural exponentiation of x, i.e., e^x.
  52. ///
  53. /// @param x exp function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision.
  54. /// @tparam genType Floating-point scalar or vector types.
  55. ///
  56. /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp.xml">GLSL exp man page</a>
  57. /// @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>
  58. template <typename genType>
  59. GLM_FUNC_DECL genType exp(genType const & x);
  60. /// Returns the natural logarithm of x, i.e.,
  61. /// returns the value y which satisfies the equation x = e^y.
  62. /// Results are undefined if x <= 0.
  63. ///
  64. /// @param x log function is defined for input values of x defined in the range (0, inf+) in the limit of the type precision.
  65. /// @tparam genType Floating-point scalar or vector types.
  66. ///
  67. /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log.xml">GLSL log man page</a>
  68. /// @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>
  69. template <typename genType>
  70. GLM_FUNC_DECL genType log(genType const & x);
  71. /// Returns 2 raised to the x power.
  72. ///
  73. /// @param x exp2 function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision.
  74. /// @tparam genType Floating-point scalar or vector types.
  75. ///
  76. /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp2.xml">GLSL exp2 man page</a>
  77. /// @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>
  78. template <typename genType>
  79. GLM_FUNC_DECL genType exp2(genType const & x);
  80. /// Returns the base 2 log of x, i.e., returns the value y,
  81. /// which satisfies the equation x = 2 ^ y.
  82. ///
  83. /// @param x log2 function is defined for input values of x defined in the range (0, inf+) in the limit of the type precision.
  84. /// @tparam genType Floating-point scalar or vector types.
  85. ///
  86. /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log2.xml">GLSL log2 man page</a>
  87. /// @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>
  88. template <typename genType>
  89. GLM_FUNC_DECL genType log2(genType const & x);
  90. /// Returns the positive square root of x.
  91. ///
  92. /// @param x sqrt function is defined for input values of x defined in the range [0, inf+) in the limit of the type precision.
  93. /// @tparam genType Floating-point scalar or vector types.
  94. ///
  95. /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sqrt.xml">GLSL sqrt man page</a>
  96. /// @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>
  97. template <typename genType>
  98. GLM_FUNC_DECL genType sqrt(genType const & x);
  99. /// Returns the reciprocal of the positive square root of x.
  100. ///
  101. /// @param x inversesqrt function is defined for input values of x defined in the range [0, inf+) in the limit of the type precision.
  102. /// @tparam genType Floating-point scalar or vector types.
  103. ///
  104. /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inversesqrt.xml">GLSL inversesqrt man page</a>
  105. /// @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>
  106. template <typename genType>
  107. GLM_FUNC_DECL genType inversesqrt(genType const & x);
  108. /// @}
  109. }//namespace glm
  110. #include "func_exponential.inl"
  111. #endif//glm_core_func_exponential