Castor3D 0.16.0
Multiplatform 3D engine
|
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 |
Angle helper class.
|
noexcept |
Default constructor.
Type castor::AngleT< Type >::cos | ( | ) | const |
Trigonometric cosine.
double castor::AngleT< Type >::cosd | ( | ) | const |
Trigonometric cosine.
float castor::AngleT< Type >::cosf | ( | ) | const |
Trigonometric cosine.
Type castor::AngleT< Type >::cosh | ( | ) | const |
Hyperbolic cosine.
|
noexcept |
Conversion to degrees.
Referenced by castor::AngleT< Type >::fromDegrees().
|
noexcept |
sets this angle value from degrees
[in] | value | Angle in degrees |
|
inlinestaticnoexcept |
Named constructor, from a degrees angle.
[in] | degrees | The angle in degrees |
References castor::AngleT< Type >::degrees(), and castor::AngleT< Type >::DegreeToRadian.
Referenced by operator""_degrees().
|
inlinestaticnoexcept |
Named constructor, from a gradients angle.
[in] | grads | The angle in gradients |
References castor::AngleT< Type >::grads(), and castor::AngleT< Type >::GradToRadian.
|
inlinestaticnoexcept |
Named constructor, from a radians angle.
[in] | radians | The angle in radians |
References castor::AngleT< Type >::radians().
Referenced by castor::SpeedTraitsT< AngleT< ValueT > >::convert(), and operator""_radians().
|
inlinestaticnoexcept |
Named constructor, from a turns angle.
[in] | turns | The angle in turns |
References castor::AngleT< Type >::turns(), and castor::AngleT< Type >::TurnToRadian.
Referenced by operator""_turns().
|
noexcept |
Conversion to gradients.
Referenced by castor::AngleT< Type >::fromGrads().
|
noexcept |
sets this angle value from gradients
[in] | value | Angle in gradients |
|
inlineexplicitnoexcept |
|
noexcept |
Multiplication assignment operator.
[in] | rhs | Angle to multiply to this one |
|
noexcept |
Multiplication assignment operator.
[in] | rhs | Scalar to multiply to this one |
|
noexcept |
addition assignment operator
[in] | rhs | Angle to add to this one |
|
noexcept |
Negation operator.
|
noexcept |
Substraction assignment operator.
[in] | rhs | Angle to subtract to this one |
|
noexcept |
Division assignment operator.
[in] | rhs | Angle divider of this one |
|
noexcept |
Division assignment operator.
[in] | rhs | Scalar divider of this one |
|
noexcept |
Conversion to radians.
Referenced by castor::AngleT< Type >::fromRadians().
|
noexcept |
sets this angle value from radians
[in] | value | Angle in radians |
Type castor::AngleT< Type >::sin | ( | ) | const |
Trigonometric sine.
double castor::AngleT< Type >::sind | ( | ) | const |
Trigonometric sine.
float castor::AngleT< Type >::sinf | ( | ) | const |
Trigonometric sine.
Type castor::AngleT< Type >::sinh | ( | ) | const |
Hyperbolic sine.
Type castor::AngleT< Type >::tan | ( | ) | const |
Trigonometric tangent.
double castor::AngleT< Type >::tand | ( | ) | const |
Trigonometric tangent.
float castor::AngleT< Type >::tanf | ( | ) | const |
Trigonometric tangent.
Type castor::AngleT< Type >::tanh | ( | ) | const |
Hyperbolic tangent.
|
noexcept |
Conversion to turns.
Referenced by castor::AngleT< Type >::fromTurns().
|
noexcept |
sets this angle value from turns
[in] | value | Angle in turns |
|
friend |
|
friend |
|
friend |
|
staticconstexpr |
Degree to gradient conversion constant.
|
staticconstexpr |
Degree to radian conversion constant.
Referenced by castor::AngleT< Type >::fromDegrees().
|
staticconstexpr |
Degree to turn conversion constant.
|
staticconstexpr |
Gradient to degree conversion constant.
|
staticconstexpr |
Gradient to radian conversion constant.
Referenced by castor::AngleT< Type >::fromGrads().
|
staticconstexpr |
Gradient to turn conversion constant.
|
staticconstexpr |
Radian to degree conversion constant.
|
staticconstexpr |
Radian to gradient conversion constant.
|
staticconstexpr |
Radian to turn conversion constant.
|
staticconstexpr |
Turn to degree conversion constant.
|
staticconstexpr |
Turn to gradient conversion constant.
|
staticconstexpr |
Turn to radian conversion constant.
Referenced by castor::AngleT< Type >::fromTurns().