Allolib  1.0
C++ Components For Interactive Multimedia
al::SphereCoord< T > Class Template Reference

Spherical coordinate in terms of two complex numbers. More...

#include <C:/Users/Andres/source/repos/casm_viewer/external/tinc/external/allolib/include/al/math/al_Spherical.hpp>

Public Types

typedef Complex< T > C
 

Public Member Functions

 SphereCoord (const C &theta=C(1, 0), const C &phi=C(1, 0))
 
template<class U >
 SphereCoord (const Vec< 3, U > &v)
 
SphereCoord operator- () const
 Get negation in Cartesian space.
 
SphereCoordoperator*= (T v)
 
SphereCoord operator* (T v) const
 
radius () const
 Get radius.
 
Vec< 3, T > toCart () const
 Returns Cartesian coordinate.
 
SphereCoordfromAngle (const T &theta, const T &phi, const T &radius=T(1))
 Set from two angles, in radians, and radius. More...
 
template<class U >
SphereCoordfromCart (const Vec< 3, U > &v)
 Set from Cartesian coordinate.
 

Public Attributes

C t
 Theta component, longitudinal angle (angle from +x towards +y)
 
C p
 Phi component, latitudinal angle (angle from +z axis)
 

Detailed Description

template<class T>
class al::SphereCoord< T >

Spherical coordinate in terms of two complex numbers.

The first component, theta, is the angle on the x-y plane and the second component, phi, is the angle from the +z axis. The magnitude of theta should always be 1, while the magnitude of phi is the radius.

Definition at line 100 of file al_Spherical.hpp.

Constructor & Destructor Documentation

◆ SphereCoord()

template<class T >
template<class U >
al::SphereCoord< T >::SphereCoord ( const Vec< 3, U > &  v)
inline
Parameters
[in]vCartesian position

Definition at line 113 of file al_Spherical.hpp.

Member Function Documentation

◆ fromAngle()

template<class T >
SphereCoord& al::SphereCoord< T >::fromAngle ( const T &  theta,
const T &  phi,
const T &  radius = T(1) 
)
inline

Set from two angles, in radians, and radius.

Parameters
[in]thetalongitudinal angle (angle from +x towards +y)
[in]philatitudinal angle (angle from +z axis)
[in]radiusradius

Definition at line 136 of file al_Spherical.hpp.


The documentation for this class was generated from the following file: