fast_trigonometry.hpp 2.3 KB

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