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

Maths Radian type. More...

#include <Radian.hpp>

Public Member Functions

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

Detailed Description

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

Maths Radian type.

Handle Degree / Radian conversion.

Constructor & Destructor Documentation

◆ Rad() [1/3]

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

Value constructor without conversion.

Parameters
[in]_radThe value in radian to assign.

◆ Rad() [2/3]

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

Value constructor without conversion.

Parameters
[in]_otherThe value in radian to assign.

◆ Rad() [3/3]

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

Value constructor from radian.

Parameters
[in]_degThe value in degree to assign.

Member Function Documentation

◆ Equals()

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

Compare 2 Rad.

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

◆ Handle()

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

Access the handled value.

Returns
handle as T without conversion.

◆ operator T()

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

Access the handled value.

Returns
handle as float without conversion.

◆ operator!=()

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

Compare 2 radian inequality.

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

◆ operator*()

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

Scale angle.

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

◆ operator*=()

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

Scale angle.

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

◆ operator+()

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

Add Radian to handle.

Parameters
[in]_rhsradian to add.
Returns
new Radian result.

◆ operator+=()

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

Add Radian to handle.

Parameters
[in]_rhsradian to add.
Returns
self Radian.

◆ operator-() [1/2]

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

Getter of the opposite signed radian.

Returns
new opposite signed radian.

◆ operator-() [2/2]

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

Substract Radian to handle.

Parameters
[in]_rhsradian to substract.
Returns
new Radian result.

◆ operator-=()

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

Substract Radian to handle.

Parameters
[in]_rhsradian to substract.
Returns
self Radian.

◆ operator/()

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

Unscale angle.

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

◆ operator/=()

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

Unscale angle.

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

◆ operator==()

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

Compare 2 radian equality.

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

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