SA_Maths
Sapphire Suite's C++ Maths Library
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SA::Deg< T > Class Template Reference

Maths Degree type. More...

#include <Degree.hpp>

Public Member Functions

 Deg ()=default
 Default contructor.
 
constexpr Deg (T _deg) noexcept
 Value constructor without conversion.
 
template<typename TIn >
constexpr Deg (Deg< TIn > _other) noexcept
 Value constructor without conversion.
 
template<typename TIn >
constexpr Deg (Rad< TIn > _rad) noexcept
 Value constructor from radian.
 
constexpr T Handle () const noexcept
 Access the handled value.
 
constexpr bool Equals (Deg _other, T _epsilon=std::numeric_limits< T >::epsilon()) const noexcept
 Compare 2 Deg.
 
void Clamp () noexcept
 clamp this angle between [-180, 180].
 
constexpr Deg operator- () const noexcept
 Getter of the opposite signed degree.
 
constexpr Deg operator+ (Deg _rhs) const noexcept
 Add degrees to handle.
 
constexpr Deg operator- (Deg _rhs) const noexcept
 Substract degrees to handle.
 
constexpr Deg operator* (T _scale) const noexcept
 Scale angle.
 
Deg operator/ (T _scale) const
 Unscale angle.
 
Degoperator+= (Deg _rhs) noexcept
 Add degrees to handle.
 
Degoperator-= (Deg _rhs) noexcept
 Substract degrees to handle.
 
Degoperator*= (T _scale) noexcept
 Scale angle.
 
Degoperator/= (T _scale)
 Unscale angle.
 
constexpr bool operator== (Deg _rhs) const noexcept
 Compare 2 degree equality.
 
constexpr bool operator!= (Deg _rhs) const noexcept
 Compare 2 degree inequality.
 
constexpr operator T () const noexcept
 Access the handled value.
 

Detailed Description

template<typename T>
class SA::Deg< T >

Maths Degree type.

Handle Degree / Radian conversion.

Constructor & Destructor Documentation

◆ Deg() [1/3]

template<typename T >
constexpr SA::Deg< T >::Deg ( T _deg)
constexprnoexcept

Value constructor without conversion.

Parameters
[in]_degThe value in degree to assign.

◆ Deg() [2/3]

template<typename T >
template<typename TIn >
constexpr SA::Deg< T >::Deg ( Deg< TIn > _other)
constexprnoexcept

Value constructor without conversion.

Parameters
[in]_otherThe value in degree to assign.

◆ Deg() [3/3]

template<typename T >
template<typename TIn >
constexpr SA::Deg< T >::Deg ( Rad< TIn > _rad)
constexprnoexcept

Value constructor from radian.

Parameters
[in]_radThe value in radian to assign.

Member Function Documentation

◆ Equals()

template<typename T >
constexpr bool SA::Deg< T >::Equals ( Deg< T > _other,
T _epsilon = std::numeric_limits< T >::epsilon() ) const
constexprnoexcept

Compare 2 Deg.

Parameters
[in]_otherOther Deg to compare to.
[in]_epsilonEpsilon value for threshold compare.
Returns
Whether this and _other are equal.

◆ Handle()

template<typename T >
constexpr T SA::Deg< T >::Handle ( ) const
constexprnoexcept

Access the handled value.

Returns
handle as T without conversion.

◆ operator T()

template<typename T >
constexpr SA::Deg< T >::operator T ( ) const
explicitconstexprnoexcept

Access the handled value.

Returns
handle as float without conversion.

◆ operator!=()

template<typename T >
constexpr bool SA::Deg< T >::operator!= ( Deg< T > _rhs) const
constexprnoexcept

Compare 2 degree inequality.

Parameters
[in]_rhsOther degree to compare to.
Returns
Whether this and _rhs are non-equal.

◆ operator*()

template<typename T >
constexpr Deg SA::Deg< T >::operator* ( T _scale) const
constexprnoexcept

Scale angle.

Parameters
[in]_scalescale to apply.
Returns
new degree result.

◆ operator*=()

template<typename T >
Deg & SA::Deg< T >::operator*= ( T _scale)
noexcept

Scale angle.

Parameters
[in]_scalescale to apply.
Returns
this degree scaled.

◆ operator+()

template<typename T >
constexpr Deg SA::Deg< T >::operator+ ( Deg< T > _rhs) const
constexprnoexcept

Add degrees to handle.

Parameters
[in]_rhsdegrees to add.
Returns
new degree result.

◆ operator+=()

template<typename T >
Deg & SA::Deg< T >::operator+= ( Deg< T > _rhs)
noexcept

Add degrees to handle.

Parameters
[in]_rhsdegrees to add.
Returns
self degree.

◆ operator-() [1/2]

template<typename T >
constexpr Deg SA::Deg< T >::operator- ( ) const
constexprnoexcept

Getter of the opposite signed degree.

Returns
new opposite signed degree.

◆ operator-() [2/2]

template<typename T >
constexpr Deg SA::Deg< T >::operator- ( Deg< T > _rhs) const
constexprnoexcept

Substract degrees to handle.

Parameters
[in]_rhsdegrees to substract.
Returns
new degree result.

◆ operator-=()

template<typename T >
Deg & SA::Deg< T >::operator-= ( Deg< T > _rhs)
noexcept

Substract degrees to handle.

Parameters
[in]_rhsdegrees to substract.
Returns
self degree.

◆ operator/()

template<typename T >
Deg SA::Deg< T >::operator/ ( T _scale) const

Unscale angle.

Parameters
[in]_scaleun-scale to apply.
Returns
new degree result.

◆ operator/=()

template<typename T >
Deg & SA::Deg< T >::operator/= ( T _scale)

Unscale angle.

Parameters
[in]_scaleun-scale to apply.
Returns
this degree unscaled.

◆ operator==()

template<typename T >
constexpr bool SA::Deg< T >::operator== ( Deg< T > _rhs) const
constexprnoexcept

Compare 2 degree equality.

Parameters
[in]_rhsOther degree to compare to.
Returns
Whether this and _rhs are equal.

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