polar_coordinates.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /// @ref gtx_polar_coordinates
  2. /// @file glm/gtx/polar_coordinates.hpp
  3. ///
  4. /// @see core (dependence)
  5. ///
  6. /// @defgroup gtx_polar_coordinates GLM_GTX_polar_coordinates
  7. /// @ingroup gtx
  8. ///
  9. /// Include <glm/gtx/polar_coordinates.hpp> to use the features of this extension.
  10. ///
  11. /// Conversion from Euclidean space to polar space and revert.
  12. #pragma once
  13. // Dependency:
  14. #include "../glm.hpp"
  15. #ifndef GLM_ENABLE_EXPERIMENTAL
  16. # error "GLM: GLM_GTX_polar_coordinates 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_polar_coordinates extension included")
  20. #endif
  21. namespace glm
  22. {
  23. /// @addtogroup gtx_polar_coordinates
  24. /// @{
  25. /// Convert Euclidean to Polar coordinates, x is the xz distance, y, the latitude and z the longitude.
  26. ///
  27. /// @see gtx_polar_coordinates
  28. template<typename T, qualifier Q>
  29. GLM_FUNC_DECL vec<3, T, Q> polar(
  30. vec<3, T, Q> const& euclidean);
  31. /// Convert Polar to Euclidean coordinates.
  32. ///
  33. /// @see gtx_polar_coordinates
  34. template<typename T, qualifier Q>
  35. GLM_FUNC_DECL vec<3, T, Q> euclidean(
  36. vec<2, T, Q> const& polar);
  37. /// @}
  38. }//namespace glm
  39. #include "polar_coordinates.inl"