summaryrefslogtreecommitdiff
path: root/src/glm/gtx/polar_coordinates.hpp
blob: 3bf6582a65275f63b0ffcfed6ee6735a9d6818f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2007-03-06
// Updated : 2009-05-01
// Licence : This source is under MIT License
// File    : glm/gtx/polar_coordinates.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
// Dependency:
// - GLM core
///////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef glm_gtx_polar_coordinates
#define glm_gtx_polar_coordinates

// Dependency:
#include "../glm.hpp"

#if(defined(GLM_MESSAGES) && !defined(glm_ext))
#	pragma message("GLM: GLM_GTX_polar_coordinates extension included")
#endif

namespace glm{
namespace gtx{
namespace polar_coordinates ///< GLM_GTX_polar_coordinates extension: Conversion from Euclidean space to polar space and revert.
{
	/// \addtogroup gtx_polar_coordinates
	/// @{

	//! Convert Euclidean to Polar coordinates, x is the xz distance, y, the latitude and z the longitude.
	//! From GLM_GTX_polar_coordinates extension.
	template <typename T> 
	detail::tvec3<T> polar(const detail::tvec3<T>& euclidean);

	//! Convert Polar to Euclidean coordinates.
	//! From GLM_GTX_polar_coordinates extension.
	template <typename T> 
	detail::tvec3<T> euclidean(const detail::tvec3<T>& polar);

	/// @}
}//namespace polar_coordinates
}//namespace gtx
}//namespace glm

#include "polar_coordinates.inl"

namespace glm{using namespace gtx::polar_coordinates;}

#endif//glm_gtx_polar_coordinates