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