Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion::math::Angle< T > Class Template Reference

A simple class to represent angles. More...

#include "angle.h"

Public Member Functions

 Angle ()
 The default constructor creates an angle of 0 (in any unit). More...
 
template<typename U >
 Angle (const Angle< U > other)
 Copy constructor from an instance of any value type that is compatible (via static_cast) with this instance's type. More...
 
T Radians () const
 Get the angle in degrees or radians. More...
 
T Degrees () const
 
const Angle operator- () const
 Unary negation operator. More...
 
void operator+= (const Angle &a)
 Self-modifying operators. More...
 
void operator-= (const Angle &a)
 
void operator*= (T s)
 
void operator/= (T s)
 

Static Public Member Functions

static Angle FromRadians (const T &angle)
 Create a angle from radians (no conversion). More...
 
static Angle FromDegrees (const T &angle)
 Create a angle from degrees (requires conversion). More...
 

Friends

const Angle operator+ (const Angle &a0, const Angle &a1)
 Binary operators. More...
 
const Angle operator- (const Angle &a0, const Angle &a1)
 
const Angle operator* (const Angle &a, T s)
 
const Angle operator* (T s, const Angle &a)
 
const Angle operator/ (const Angle &a, T s)
 
bool operator== (const Angle &a0, const Angle &a1)
 Exact equality and inequality comparisons. More...
 
bool operator!= (const Angle &a0, const Angle &a1)
 
bool operator< (const Angle &a0, const Angle &a1)
 Comparisons. More...
 
bool operator> (const Angle &a0, const Angle &a1)
 
bool operator<= (const Angle &a0, const Angle &a1)
 
bool operator>= (const Angle &a0, const Angle &a1)
 

Detailed Description

template<typename T>
class ion::math::Angle< T >

A simple class to represent angles.

The fundamental angular unit is radians, with conversion provided to and from degrees.

Definition at line 33 of file angle.h.

Constructor & Destructor Documentation

template<typename T>
ion::math::Angle< T >::Angle ( )
inline

The default constructor creates an angle of 0 (in any unit).

Definition at line 36 of file angle.h.

Referenced by ion::math::Angle< T >::FromDegrees(), and ion::math::Angle< T >::FromRadians().

template<typename T>
template<typename U >
ion::math::Angle< T >::Angle ( const Angle< U >  other)
inlineexplicit

Copy constructor from an instance of any value type that is compatible (via static_cast) with this instance's type.

Definition at line 41 of file angle.h.

Member Function Documentation

template<typename T>
T ion::math::Angle< T >::Degrees ( ) const
inline

Definition at line 56 of file angle.h.

template<typename T>
static Angle ion::math::Angle< T >::FromDegrees ( const T angle)
inlinestatic

Create a angle from degrees (requires conversion).

Definition at line 50 of file angle.h.

References ion::math::Angle< T >::Angle().

Referenced by ion::math::operator>>().

template<typename T>
static Angle ion::math::Angle< T >::FromRadians ( const T angle)
inlinestatic
template<typename T>
void ion::math::Angle< T >::operator*= ( T  s)
inline

Definition at line 66 of file angle.h.

template<typename T>
void ion::math::Angle< T >::operator+= ( const Angle< T > &  a)
inline

Self-modifying operators.

Definition at line 64 of file angle.h.

template<typename T>
const Angle ion::math::Angle< T >::operator- ( ) const
inline

Unary negation operator.

Todo:
(user): add "wrap around 2_pi" functions?

Definition at line 61 of file angle.h.

References ion::math::Angle< T >::FromRadians().

template<typename T>
void ion::math::Angle< T >::operator-= ( const Angle< T > &  a)
inline

Definition at line 65 of file angle.h.

template<typename T>
void ion::math::Angle< T >::operator/= ( T  s)
inline

Definition at line 67 of file angle.h.

template<typename T>
T ion::math::Angle< T >::Radians ( ) const
inline

Get the angle in degrees or radians.

Definition at line 55 of file angle.h.

Referenced by ion::math::Cosine(), ion::math::PerspectiveMatrixFromView(), ion::math::Sine(), and ion::math::Tangent().

Friends And Related Function Documentation

template<typename T>
bool operator!= ( const Angle< T > &  a0,
const Angle< T > &  a1 
)
friend

Definition at line 90 of file angle.h.

template<typename T>
const Angle operator* ( const Angle< T > &  a,
T  s 
)
friend

Definition at line 76 of file angle.h.

template<typename T>
const Angle operator* ( T  s,
const Angle< T > &  a 
)
friend

Definition at line 79 of file angle.h.

template<typename T>
const Angle operator+ ( const Angle< T > &  a0,
const Angle< T > &  a1 
)
friend

Binary operators.

Definition at line 70 of file angle.h.

template<typename T>
const Angle operator- ( const Angle< T > &  a0,
const Angle< T > &  a1 
)
friend

Definition at line 73 of file angle.h.

template<typename T>
const Angle operator/ ( const Angle< T > &  a,
T  s 
)
friend

Definition at line 82 of file angle.h.

template<typename T>
bool operator< ( const Angle< T > &  a0,
const Angle< T > &  a1 
)
friend

Comparisons.

Definition at line 95 of file angle.h.

template<typename T>
bool operator<= ( const Angle< T > &  a0,
const Angle< T > &  a1 
)
friend

Definition at line 101 of file angle.h.

template<typename T>
bool operator== ( const Angle< T > &  a0,
const Angle< T > &  a1 
)
friend

Exact equality and inequality comparisons.

Definition at line 87 of file angle.h.

template<typename T>
bool operator> ( const Angle< T > &  a0,
const Angle< T > &  a1 
)
friend

Definition at line 98 of file angle.h.

template<typename T>
bool operator>= ( const Angle< T > &  a0,
const Angle< T > &  a1 
)
friend

Definition at line 104 of file angle.h.


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