25 #ifndef WUNITSPHERECOORDINATES_H
26 #define WUNITSPHERECOORDINATES_H
31 #include "../../common/math/linearAlgebra/WMatrixFixed.h"
113 template<
typename T >
120 template<
typename T >
127 template<
typename T >
130 setEuclidean( vector );
133 template<
typename T >
138 template<
typename T >
144 template<
typename T >
150 template<
typename T >
156 template<
typename T >
162 template<
typename T >
165 return WMatrixFixed< T, 3, 1 >( std::sin( m_theta )*std::cos( m_phi ), std::sin( m_theta )*std::sin( m_phi ), std::cos( m_theta ) );
168 template<
typename T >
171 vector = normalize( vector );
173 m_theta = std::acos( vector[2] );
174 m_phi = std::atan2( vector[1], vector[0] );
This class stores coordinates on the unit sphere.
void setPhi(T phi)
Set phi angle.
T getTheta() const
Return the theta angle.
void setEuclidean(WMatrixFixed< T, 3, 1 > vector)
Returns the stored sphere coordinates as Euclidean coordinates.
void setTheta(T theta)
Set theta angle.
WUnitSphereCoordinates()
Default constructor.
virtual ~WUnitSphereCoordinates()
Destructor.
T getPhi() const
Return the phi angle.
WMatrixFixed< T, 3, 1 > getEuclidean() const
Returns the stored sphere coordinates as Euclidean coordinates.