sculpto
Public Member Functions | Public Attributes | List of all members
scl::math::radians< T > Struct Template Reference

#include <angle_measure.h>

Public Member Functions

 radians ()=default
 
 radians (T Value)
 
const radiansoperator= (const radians &Other)
 
bool operator== (const radians &Other)
 
const radians operator- () const
 
const radians operator+ (const radians &Other) const
 
const radiansoperator+= (const radians &Other)
 
const radians operator- (const radians &Other) const
 
const radiansoperator-= (const radians &Other)
 
const radians operator* (const radians &Other) const
 
const radiansoperator*= (const radians &Other)
 
const radians operator/ (const radians &Other) const
 
const radiansoperator/= (const radians &Other)
 
 operator degrees< T > ()
 
 operator T ()
 

Public Attributes

Value { 0 }
 

Detailed Description

template<typename T>
struct scl::math::radians< T >

Angle measure types forward declaration.

Radians angle type class.

Definition at line 21 of file angle_measure.h.

Constructor & Destructor Documentation

◆ radians() [1/2]

template<typename T >
scl::math::radians< T >::radians ( )
default

Angle value in radians.

Radians angle default constructor.

◆ radians() [2/2]

template<typename T >
scl::math::radians< T >::radians ( Value)
inline
  • Radians angle constructor by value.
Parameters
Value- angle value.

Definition at line 34 of file angle_measure.h.

Member Function Documentation

◆ operator degrees< T >()

template<typename T >
scl::math::radians< T >::operator degrees< T > ( )
inline
  • СCast to degree measure from radians to degrees.
Returns
angle in degrees.

Definition at line 166 of file angle_measure.h.

166{ return degrees<T>(Value * 180.0 / PI); }
const float PI
Definition: math_common.h:33

◆ operator T()

template<typename T >
scl::math::radians< T >::operator T ( )
inline
  • Cast to scalar type.
Returns
angle value.

Definition at line 173 of file angle_measure.h.

173{ return Value; }

◆ operator*()

template<typename T >
const radians scl::math::radians< T >::operator* ( const radians< T > &  Other) const
inline
  • Radians degrees multiplying operator overloading.
Parameters
Other- radians angle to multiply.
Returns
radians angle with multiplied coordinates.

Definition at line 121 of file angle_measure.h.

122 {
123 return radians(Value * Other.Value);
124 }

◆ operator*=()

template<typename T >
const radians & scl::math::radians< T >::operator*= ( const radians< T > &  Other)
inline
  • Radians degrees multiplying with assigments operator overlaoding.
Parameters
Other- radians angle to multiply.
Returns
self reference.

Definition at line 132 of file angle_measure.h.

133 {
134 Value *= Other.Value;
135 return *this;
136 }

◆ operator+()

template<typename T >
const radians scl::math::radians< T >::operator+ ( const radians< T > &  Other) const
inline
  • Radians degrees addition operator overloading.
Parameters
Other- radians angle to add.
Returns
radians angle with added coordinates.

Definition at line 75 of file angle_measure.h.

76 {
77 return radians(Value + Other.Value);
78 }

◆ operator+=()

template<typename T >
const radians & scl::math::radians< T >::operator+= ( const radians< T > &  Other)
inline
  • Radians degrees addition with assigments operator overlaoding.
Parameters
Other- radians angle to add.
Returns
self reference

Definition at line 86 of file angle_measure.h.

87 {
88 Value += Other.Value;
89 return *this;
90 }

◆ operator-() [1/2]

template<typename T >
const radians scl::math::radians< T >::operator- ( ) const
inline
  • Getting negative radians angle operation.
Parameters
None.
Returns
negative radians angle.

Definition at line 64 of file angle_measure.h.

65 {
66 return radians(-Value);
67 }

◆ operator-() [2/2]

template<typename T >
const radians scl::math::radians< T >::operator- ( const radians< T > &  Other) const
inline
  • Radians degrees subtraction operator overloading.
Parameters
Other- radians angle to subtract.
Returns
radians angle with subtract coordinates.

Definition at line 98 of file angle_measure.h.

99 {
100 return radians(Value - Other.Value);
101 }

◆ operator-=()

template<typename T >
const radians & scl::math::radians< T >::operator-= ( const radians< T > &  Other)
inline
  • Radians degrees subtraction with assigments operator overlaoding.
Parameters
Other- radians angle to subtract.
Returns
self reference.

Definition at line 109 of file angle_measure.h.

110 {
111 Value -= Other.Value;
112 return *this;
113 }

◆ operator/()

template<typename T >
const radians scl::math::radians< T >::operator/ ( const radians< T > &  Other) const
inline
  • Radians degrees dividing operator overloading.
Parameters
Other- radians angle to devide.
Returns
radians angle with devided coordinates.

Definition at line 144 of file angle_measure.h.

145 {
146 return radians(Value / Other.Value);
147 }

◆ operator/=()

template<typename T >
const radians & scl::math::radians< T >::operator/= ( const radians< T > &  Other)
inline
  • Radians degrees dividing with assigments operator overlaoding.
Parameters
Other- radians angle to devide.
Returns
self reference.

Definition at line 155 of file angle_measure.h.

156 {
157 Value /= Other.Value;
158 return *this;
159 }

◆ operator=()

template<typename T >
const radians & scl::math::radians< T >::operator= ( const radians< T > &  Other)
inline
  • Radians copy constructor.
Parameters
Other
Returns

Definition at line 42 of file angle_measure.h.

42 {
43 if (this != &Other) Value = Other.Value;
44 return *this;
45 }

◆ operator==()

template<typename T >
bool scl::math::radians< T >::operator== ( const radians< T > &  Other)
inline
  • Radians angle compare function.
Parameters
Other- radians angle to compare with.
Returns
is radians degrees equal flag.

Definition at line 53 of file angle_measure.h.

54 {
55 return Value == Other.Value;
56 }

Member Data Documentation

◆ Value

template<typename T >
T scl::math::radians< T >::Value { 0 }

Definition at line 24 of file angle_measure.h.


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