polar_coordinates.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  16. # ifndef GLM_ENABLE_EXPERIMENTAL
  17. # pragma message("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.")
  18. # else
  19. # pragma message("GLM: GLM_GTX_polar_coordinates extension included")
  20. # endif
  21. #endif
  22. namespace glm
  23. {
  24. /// @addtogroup gtx_polar_coordinates
  25. /// @{
  26. /// Convert Euclidean to Polar coordinates, x is the latitude, y the longitude and z the xz distance.
  27. ///
  28. /// @see gtx_polar_coordinates
  29. template<typename T, qualifier Q>
  30. GLM_FUNC_DECL vec<3, T, Q> polar(
  31. vec<3, T, Q> const& euclidean);
  32. /// Convert Polar to Euclidean coordinates.
  33. ///
  34. /// @see gtx_polar_coordinates
  35. template<typename T, qualifier Q>
  36. GLM_FUNC_DECL vec<3, T, Q> euclidean(
  37. vec<2, T, Q> const& polar);
  38. /// @}
  39. }//namespace glm
  40. #include "polar_coordinates.inl"