Castor3D 0.16.0
Multiplatform 3D engine
Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
castor::AngleT< Type > Class Template Reference

Angle helper class. More...

#include <Angle.hpp>

Public Member Functions

 AngleT () noexcept
 Default constructor.
 
Type turns () const noexcept
 Conversion to turns.
 
Type degrees () const noexcept
 Conversion to degrees.
 
Type radians () const noexcept
 Conversion to radians.
 
Type grads () const noexcept
 Conversion to gradients.
 
void turns (double value) noexcept
 sets this angle value from turns
 
void degrees (double value) noexcept
 sets this angle value from degrees
 
void radians (double value) noexcept
 sets this angle value from radians
 
void grads (double value) noexcept
 sets this angle value from gradients
 
Type cos () const
 Trigonometric cosine.
 
Type sin () const
 Trigonometric sine.
 
Type tan () const
 Trigonometric tangent.
 
float cosf () const
 Trigonometric cosine.
 
float sinf () const
 Trigonometric sine.
 
float tanf () const
 Trigonometric tangent.
 
double cosd () const
 Trigonometric cosine.
 
double sind () const
 Trigonometric sine.
 
double tand () const
 Trigonometric tangent.
 
Type cosh () const
 Hyperbolic cosine.
 
Type sinh () const
 Hyperbolic sine.
 
Type tanh () const
 Hyperbolic tangent.
 
AngleT< Type > operator- () const noexcept
 Negation operator.
 
AngleT< Type > & operator+= (AngleT< Type > const &rhs) noexcept
 addition assignment operator
 
AngleT< Type > & operator-= (AngleT< Type > const &rhs) noexcept
 Substraction assignment operator.
 
AngleT< Type > & operator*= (AngleT< Type > const &rhs) noexcept
 Multiplication assignment operator.
 
AngleT< Type > & operator/= (AngleT< Type > const &rhs) noexcept
 Division assignment operator.
 
AngleT< Type > & operator*= (double rhs) noexcept
 Multiplication assignment operator.
 
AngleT< Type > & operator/= (double rhs) noexcept
 Division assignment operator.
 
 operator Type () const noexcept
 

Static Public Member Functions

template<typename T >
static AngleT< Type > fromTurns (T turns) noexcept
 Named constructor, from a turns angle.
 
template<typename T >
static AngleT< Type > fromDegrees (T degrees) noexcept
 Named constructor, from a degrees angle.
 
template<typename T >
static AngleT< Type > fromRadians (T radians) noexcept
 Named constructor, from a radians angle.
 
template<typename T >
static AngleT< Type > fromGrads (T grads) noexcept
 Named constructor, from a gradients angle.
 

Static Public Attributes

static CU_API constexpr Type TurnToRadian { Type( Tau< double > ) }
 
static CU_API constexpr Type TurnToDegree { Type( 360.0 ) }
 
static CU_API constexpr Type TurnToGrad { Type( 400.0 ) }
 
static CU_API constexpr Type RadianToTurn { Type( 1.0 / Tau< double > ) }
 
static CU_API constexpr Type RadianToDegree { Type( 57.295779513082320876798154814105 ) }
 
static CU_API constexpr Type RadianToGrad { 200 / Pi< Type > }
 
static CU_API constexpr Type DegreeToTurn { Type( 1.0 / 360.0 ) }
 
static CU_API constexpr Type DegreeToRadian { Type( 0.01745329251994329576923690768489 ) }
 
static CU_API constexpr Type DegreeToGrad { Type( 200 ) / 180 }
 
static CU_API constexpr Type GradToTurn { Type( 1 ) / 400 }
 
static CU_API constexpr Type GradToDegree { Type( 180 ) / 200 }
 
static CU_API constexpr Type GradToRadian { 180 / Type( 200 ) }
 

Friends

template<typename T >
bool operator== (AngleT< T > const &lhs, AngleT< T > const &rhs) noexcept
 
template<typename T >
bool operator< (AngleT< T > const &lhs, AngleT< T > const &rhs) noexcept
 
template<typename T >
bool operator> (AngleT< T > const &lhs, AngleT< T > const &rhs) noexcept
 

Detailed Description

template<typename Type>
class castor::AngleT< Type >

Angle helper class.

Remarks
Handles angle units conversions.

Constructor & Destructor Documentation

◆ AngleT()

template<typename Type >
castor::AngleT< Type >::AngleT ( )
noexcept

Default constructor.

Member Function Documentation

◆ cos()

template<typename Type >
Type castor::AngleT< Type >::cos ( ) const

Trigonometric cosine.

Returns
Cosine of this angle

◆ cosd()

template<typename Type >
double castor::AngleT< Type >::cosd ( ) const

Trigonometric cosine.

Returns
Cosine of this angle

◆ cosf()

template<typename Type >
float castor::AngleT< Type >::cosf ( ) const

Trigonometric cosine.

Returns
Cosine of this angle

◆ cosh()

template<typename Type >
Type castor::AngleT< Type >::cosh ( ) const

Hyperbolic cosine.

Returns
Hyperbolic cosine of this angle

◆ degrees() [1/2]

template<typename Type >
Type castor::AngleT< Type >::degrees ( ) const
noexcept

Conversion to degrees.

Returns
Angle value, in degrees

Referenced by castor::AngleT< Type >::fromDegrees().

Here is the caller graph for this function:

◆ degrees() [2/2]

template<typename Type >
void castor::AngleT< Type >::degrees ( double value)
noexcept

sets this angle value from degrees

Parameters
[in]valueAngle in degrees

◆ fromDegrees()

template<typename Type >
template<typename T >
static AngleT< Type > castor::AngleT< Type >::fromDegrees ( T degrees)
inlinestaticnoexcept

Named constructor, from a degrees angle.

Parameters
[in]degreesThe angle in degrees
Returns
The built angle

References castor::AngleT< Type >::degrees(), and castor::AngleT< Type >::DegreeToRadian.

Referenced by operator""_degrees().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fromGrads()

template<typename Type >
template<typename T >
static AngleT< Type > castor::AngleT< Type >::fromGrads ( T grads)
inlinestaticnoexcept

Named constructor, from a gradients angle.

Parameters
[in]gradsThe angle in gradients
Returns
The built angle

References castor::AngleT< Type >::grads(), and castor::AngleT< Type >::GradToRadian.

Here is the call graph for this function:

◆ fromRadians()

template<typename Type >
template<typename T >
static AngleT< Type > castor::AngleT< Type >::fromRadians ( T radians)
inlinestaticnoexcept

Named constructor, from a radians angle.

Parameters
[in]radiansThe angle in radians
Returns
The built angle

References castor::AngleT< Type >::radians().

Referenced by castor::SpeedTraitsT< AngleT< ValueT > >::convert(), and operator""_radians().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fromTurns()

template<typename Type >
template<typename T >
static AngleT< Type > castor::AngleT< Type >::fromTurns ( T turns)
inlinestaticnoexcept

Named constructor, from a turns angle.

Parameters
[in]turnsThe angle in turns
Returns
The built angle

References castor::AngleT< Type >::turns(), and castor::AngleT< Type >::TurnToRadian.

Referenced by operator""_turns().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ grads() [1/2]

template<typename Type >
Type castor::AngleT< Type >::grads ( ) const
noexcept

Conversion to gradients.

Returns
Angle value, in gradients

Referenced by castor::AngleT< Type >::fromGrads().

Here is the caller graph for this function:

◆ grads() [2/2]

template<typename Type >
void castor::AngleT< Type >::grads ( double value)
noexcept

sets this angle value from gradients

Parameters
[in]valueAngle in gradients

◆ operator Type()

template<typename Type >
castor::AngleT< Type >::operator Type ( ) const
inlineexplicitnoexcept
Returns
The angle value, in radians.

◆ operator*=() [1/2]

template<typename Type >
AngleT< Type > & castor::AngleT< Type >::operator*= ( AngleT< Type > const & rhs)
noexcept

Multiplication assignment operator.

Parameters
[in]rhsAngle to multiply to this one
Returns
A reference to this angle

◆ operator*=() [2/2]

template<typename Type >
AngleT< Type > & castor::AngleT< Type >::operator*= ( double rhs)
noexcept

Multiplication assignment operator.

Parameters
[in]rhsScalar to multiply to this one
Returns
A reference to this angle

◆ operator+=()

template<typename Type >
AngleT< Type > & castor::AngleT< Type >::operator+= ( AngleT< Type > const & rhs)
noexcept

addition assignment operator

Parameters
[in]rhsAngle to add to this one
Returns
A reference to this angle

◆ operator-()

template<typename Type >
AngleT< Type > castor::AngleT< Type >::operator- ( ) const
noexcept

Negation operator.

Returns
A reference to this angle.

◆ operator-=()

template<typename Type >
AngleT< Type > & castor::AngleT< Type >::operator-= ( AngleT< Type > const & rhs)
noexcept

Substraction assignment operator.

Parameters
[in]rhsAngle to subtract to this one
Returns
A reference to this angle

◆ operator/=() [1/2]

template<typename Type >
AngleT< Type > & castor::AngleT< Type >::operator/= ( AngleT< Type > const & rhs)
noexcept

Division assignment operator.

Parameters
[in]rhsAngle divider of this one
Returns
A reference to this angle

◆ operator/=() [2/2]

template<typename Type >
AngleT< Type > & castor::AngleT< Type >::operator/= ( double rhs)
noexcept

Division assignment operator.

Parameters
[in]rhsScalar divider of this one
Returns
A reference to this angle

◆ radians() [1/2]

template<typename Type >
Type castor::AngleT< Type >::radians ( ) const
noexcept

Conversion to radians.

Returns
Angle value, in radians

Referenced by castor::AngleT< Type >::fromRadians().

Here is the caller graph for this function:

◆ radians() [2/2]

template<typename Type >
void castor::AngleT< Type >::radians ( double value)
noexcept

sets this angle value from radians

Parameters
[in]valueAngle in radians

◆ sin()

template<typename Type >
Type castor::AngleT< Type >::sin ( ) const

Trigonometric sine.

Returns
sine of this angle

◆ sind()

template<typename Type >
double castor::AngleT< Type >::sind ( ) const

Trigonometric sine.

Returns
sine of this angle

◆ sinf()

template<typename Type >
float castor::AngleT< Type >::sinf ( ) const

Trigonometric sine.

Returns
sine of this angle

◆ sinh()

template<typename Type >
Type castor::AngleT< Type >::sinh ( ) const

Hyperbolic sine.

Returns
Hyperbolic sine of this angle

◆ tan()

template<typename Type >
Type castor::AngleT< Type >::tan ( ) const

Trigonometric tangent.

Returns
Tangent of this angle

◆ tand()

template<typename Type >
double castor::AngleT< Type >::tand ( ) const

Trigonometric tangent.

Returns
Tangent of this angle

◆ tanf()

template<typename Type >
float castor::AngleT< Type >::tanf ( ) const

Trigonometric tangent.

Returns
Tangent of this angle

◆ tanh()

template<typename Type >
Type castor::AngleT< Type >::tanh ( ) const

Hyperbolic tangent.

Returns
Hyperbolic tangent of this angle

◆ turns() [1/2]

template<typename Type >
Type castor::AngleT< Type >::turns ( ) const
noexcept

Conversion to turns.

Returns
Angle value, in turns

Referenced by castor::AngleT< Type >::fromTurns().

Here is the caller graph for this function:

◆ turns() [2/2]

template<typename Type >
void castor::AngleT< Type >::turns ( double value)
noexcept

sets this angle value from turns

Parameters
[in]valueAngle in turns

Friends And Related Symbol Documentation

◆ operator<

template<typename Type >
template<typename T >
bool operator< ( AngleT< T > const & lhs,
AngleT< T > const & rhs )
friend

◆ operator==

template<typename Type >
template<typename T >
bool operator== ( AngleT< T > const & lhs,
AngleT< T > const & rhs )
friend

◆ operator>

template<typename Type >
template<typename T >
bool operator> ( AngleT< T > const & lhs,
AngleT< T > const & rhs )
friend

Member Data Documentation

◆ DegreeToGrad

template<typename Type >
CU_API constexpr Type castor::AngleT< Type >::DegreeToGrad { Type( 200 ) / 180 }
staticconstexpr

Degree to gradient conversion constant.

◆ DegreeToRadian

template<typename Type >
CU_API constexpr Type castor::AngleT< Type >::DegreeToRadian { Type( 0.01745329251994329576923690768489 ) }
staticconstexpr

Degree to radian conversion constant.

Referenced by castor::AngleT< Type >::fromDegrees().

◆ DegreeToTurn

template<typename Type >
CU_API constexpr Type castor::AngleT< Type >::DegreeToTurn { Type( 1.0 / 360.0 ) }
staticconstexpr

Degree to turn conversion constant.

◆ GradToDegree

template<typename Type >
CU_API constexpr Type castor::AngleT< Type >::GradToDegree { Type( 180 ) / 200 }
staticconstexpr

Gradient to degree conversion constant.

◆ GradToRadian

template<typename Type >
CU_API constexpr Type castor::AngleT< Type >::GradToRadian { 180 / Type( 200 ) }
staticconstexpr

Gradient to radian conversion constant.

Referenced by castor::AngleT< Type >::fromGrads().

◆ GradToTurn

template<typename Type >
CU_API constexpr Type castor::AngleT< Type >::GradToTurn { Type( 1 ) / 400 }
staticconstexpr

Gradient to turn conversion constant.

◆ RadianToDegree

template<typename Type >
CU_API constexpr Type castor::AngleT< Type >::RadianToDegree { Type( 57.295779513082320876798154814105 ) }
staticconstexpr

Radian to degree conversion constant.

◆ RadianToGrad

template<typename Type >
CU_API constexpr Type castor::AngleT< Type >::RadianToGrad { 200 / Pi< Type > }
staticconstexpr

Radian to gradient conversion constant.

◆ RadianToTurn

template<typename Type >
CU_API constexpr Type castor::AngleT< Type >::RadianToTurn { Type( 1.0 / Tau< double > ) }
staticconstexpr

Radian to turn conversion constant.

◆ TurnToDegree

template<typename Type >
CU_API constexpr Type castor::AngleT< Type >::TurnToDegree { Type( 360.0 ) }
staticconstexpr

Turn to degree conversion constant.

◆ TurnToGrad

template<typename Type >
CU_API constexpr Type castor::AngleT< Type >::TurnToGrad { Type( 400.0 ) }
staticconstexpr

Turn to gradient conversion constant.

◆ TurnToRadian

template<typename Type >
CU_API constexpr Type castor::AngleT< Type >::TurnToRadian { Type( Tau< double > ) }
staticconstexpr

Turn to radian conversion constant.

Referenced by castor::AngleT< Type >::fromTurns().


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