fast_trigonometry.hpp 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /// @ref gtx_fast_trigonometry
  2. /// @file glm/gtx/fast_trigonometry.hpp
  3. ///
  4. /// @see core (dependence)
  5. ///
  6. /// @defgroup gtx_fast_trigonometry GLM_GTX_fast_trigonometry
  7. /// @ingroup gtx
  8. ///
  9. /// Include <glm/gtx/fast_trigonometry.hpp> to use the features of this extension.
  10. ///
  11. /// Fast but less accurate implementations of trigonometric functions.
  12. #pragma once
  13. // Dependency:
  14. #include "../gtc/constants.hpp"
  15. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  16. # ifndef GLM_ENABLE_EXPERIMENTAL
  17. # pragma message("GLM: GLM_GTX_fast_trigonometry is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.")
  18. # else
  19. # pragma message("GLM: GLM_GTX_fast_trigonometry extension included")
  20. # endif
  21. #endif
  22. namespace glm
  23. {
  24. /// @addtogroup gtx_fast_trigonometry
  25. /// @{
  26. /// Wrap an angle to [0 2pi[
  27. /// From GLM_GTX_fast_trigonometry extension.
  28. template<typename T>
  29. GLM_FUNC_DECL T wrapAngle(T angle);
  30. /// Faster than the common sin function but less accurate.
  31. /// From GLM_GTX_fast_trigonometry extension.
  32. template<typename T>
  33. GLM_FUNC_DECL T fastSin(T angle);
  34. /// Faster than the common cos function but less accurate.
  35. /// From GLM_GTX_fast_trigonometry extension.
  36. template<typename T>
  37. GLM_FUNC_DECL T fastCos(T angle);
  38. /// Faster than the common tan function but less accurate.
  39. /// Defined between -2pi and 2pi.
  40. /// From GLM_GTX_fast_trigonometry extension.
  41. template<typename T>
  42. GLM_FUNC_DECL T fastTan(T angle);
  43. /// Faster than the common asin function but less accurate.
  44. /// Defined between -2pi and 2pi.
  45. /// From GLM_GTX_fast_trigonometry extension.
  46. template<typename T>
  47. GLM_FUNC_DECL T fastAsin(T angle);
  48. /// Faster than the common acos function but less accurate.
  49. /// Defined between -2pi and 2pi.
  50. /// From GLM_GTX_fast_trigonometry extension.
  51. template<typename T>
  52. GLM_FUNC_DECL T fastAcos(T angle);
  53. /// Faster than the common atan function but less accurate.
  54. /// Defined between -2pi and 2pi.
  55. /// From GLM_GTX_fast_trigonometry extension.
  56. template<typename T>
  57. GLM_FUNC_DECL T fastAtan(T y, T x);
  58. /// Faster than the common atan function but less accurate.
  59. /// Defined between -2pi and 2pi.
  60. /// From GLM_GTX_fast_trigonometry extension.
  61. template<typename T>
  62. GLM_FUNC_DECL T fastAtan(T angle);
  63. /// @}
  64. }//namespace glm
  65. #include "fast_trigonometry.inl"