func_exponential.hpp 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. ///////////////////////////////////////////////////////////////////////////////////////////////////
  2. // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
  3. ///////////////////////////////////////////////////////////////////////////////////////////////////
  4. // Created : 2008-08-08
  5. // Updated : 2010-02-04
  6. // Licence : This source is under MIT License
  7. // File : glm/core/func_exponential.hpp
  8. ///////////////////////////////////////////////////////////////////////////////////////////////////
  9. #ifndef glm_core_func_exponential
  10. #define glm_core_func_exponential
  11. namespace glm
  12. {
  13. namespace core{
  14. namespace function{
  15. //! Define all exponential functions from Section 8.2 of GLSL 1.30.8 specification. Included in glm namespace.
  16. namespace exponential{
  17. /// \addtogroup core_funcs
  18. ///@{
  19. //! Returns x raised to the y power.
  20. //!
  21. //! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/pow.xml">GLSL pow man page</a>
  22. //! \li GLSL 1.30.08 specification, section 8.2
  23. template <typename genType>
  24. genType pow(genType const & x, genType const & y);
  25. //! Returns the natural exponentiation of x, i.e., e^x.
  26. //!
  27. //! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp.xml">GLSL exp man page</a>
  28. //! \li GLSL 1.30.08 specification, section 8.2
  29. template <typename genType>
  30. genType exp(genType const & x);
  31. //! Returns the natural logarithm of x, i.e.,
  32. //! returns the value y which satisfies the equation x = e^y.
  33. //! Results are undefined if x <= 0.
  34. //!
  35. //! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log.xml">GLSL log man page</a>
  36. //! \li GLSL 1.30.08 specification, section 8.2
  37. template <typename genType>
  38. genType log(genType const & x);
  39. //! Returns 2 raised to the x power.
  40. //!
  41. //! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp2.xml">GLSL exp2 man page</a>
  42. //! \li GLSL 1.30.08 specification, section 8.2
  43. template <typename genType>
  44. genType exp2(genType const & x);
  45. //! Returns the base 2 log of x, i.e., returns the value y,
  46. //! which satisfies the equation x = 2 ^ y.
  47. //!
  48. //! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log2.xml">GLSL log2 man page</a>
  49. //! \li GLSL 1.30.08 specification, section 8.2
  50. template <typename genType>
  51. genType log2(genType const & x);
  52. //! Returns the positive square root of x.
  53. //!
  54. //! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sqrt.xml">GLSL sqrt man page</a>
  55. //! \li GLSL 1.30.08 specification, section 8.2
  56. template <typename genType>
  57. genType sqrt(genType const & x);
  58. //! Returns the reciprocal of the positive square root of x.
  59. //!
  60. //! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inversesqrt.xml">GLSL inversesqrt man page</a>
  61. //! \li GLSL 1.30.08 specification, section 8.2
  62. template <typename genType>
  63. genType inversesqrt(genType const & x);
  64. ///@}
  65. }//namespace exponential
  66. }//namespace function
  67. }//namespace core
  68. using namespace core::function::exponential;
  69. }//namespace glm
  70. #include "func_exponential.inl"
  71. #endif//glm_core_func_exponential