fast_trigonometry.hpp 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. #ifndef GLM_ENABLE_EXPERIMENTAL
  16. # error "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."
  17. #endif
  18. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  19. # pragma message("GLM: GLM_GTX_fast_trigonometry extension included")
  20. #endif
  21. namespace glm
  22. {
  23. /// @addtogroup gtx_fast_trigonometry
  24. /// @{
  25. /// Wrap an angle to [0 2pi[
  26. /// From GLM_GTX_fast_trigonometry extension.
  27. template<typename T>
  28. GLM_FUNC_DECL T wrapAngle(T angle);
  29. /// Faster than the common sin function but less accurate.
  30. /// From GLM_GTX_fast_trigonometry extension.
  31. template<typename T>
  32. GLM_FUNC_DECL T fastSin(T angle);
  33. /// Faster than the common cos function but less accurate.
  34. /// From GLM_GTX_fast_trigonometry extension.
  35. template<typename T>
  36. GLM_FUNC_DECL T fastCos(T angle);
  37. /// Faster than the common tan function but less accurate.
  38. /// Defined between -2pi and 2pi.
  39. /// From GLM_GTX_fast_trigonometry extension.
  40. template<typename T>
  41. GLM_FUNC_DECL T fastTan(T angle);
  42. /// Faster than the common asin function but less accurate.
  43. /// Defined between -2pi and 2pi.
  44. /// From GLM_GTX_fast_trigonometry extension.
  45. template<typename T>
  46. GLM_FUNC_DECL T fastAsin(T angle);
  47. /// Faster than the common acos function but less accurate.
  48. /// Defined between -2pi and 2pi.
  49. /// From GLM_GTX_fast_trigonometry extension.
  50. template<typename T>
  51. GLM_FUNC_DECL T fastAcos(T angle);
  52. /// Faster than the common atan function but less accurate.
  53. /// Defined between -2pi and 2pi.
  54. /// From GLM_GTX_fast_trigonometry extension.
  55. template<typename T>
  56. GLM_FUNC_DECL T fastAtan(T y, T x);
  57. /// Faster than the common atan function but less accurate.
  58. /// Defined between -2pi and 2pi.
  59. /// From GLM_GTX_fast_trigonometry extension.
  60. template<typename T>
  61. GLM_FUNC_DECL T fastAtan(T angle);
  62. /// @}
  63. }//namespace glm
  64. #include "fast_trigonometry.inl"