MathLib
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
BasicDegree< T > Class Template Reference

#include <math/Angle.hpp>

Public Types

Types
using value_type = T
 The underlying implementation type.
 

Public Member Functions

constexpr BasicDegree< T > modulo () const
 
Constructors
constexpr BasicDegree ()=default
 Defaults to 0.
 
constexpr BasicDegree (T value)
 
constexpr BasicDegree (const BasicRadian< T > &value)
 
Conversion Operators
 operator BasicRadian< T > () const
 
Element Access
T value () const
 
Invalid Value Check
constexpr bool isNaN () const
 
constexpr bool isInf () const
 

Static Public Member Functions

static constexpr T modulus ()
 
Constants
static constexpr BasicDegree< T > zero ()
 

Friends

constexpr bool approximately_equal_to (const BasicDegree< T > &value_to_test, const BasicDegree< T > &value_it_should_be, T tolerance=T{0.0002})
 
Comparison
constexpr auto operator<=> (const BasicDegree< T > &left, const BasicDegree< T > &right)=default
 

Related Symbols

(Note that these are not member symbols.)

Type Aliases
using Degreef = BasicDegree< float >
 
using Degreed = BasicDegree< double >
 
using Degree = BasicDegree< double >
 
using Degreel = BasicDegree< long double >
 

Operators

constexpr BasicDegree< T > & operator+= (const BasicDegree< T > &other)
 
constexpr BasicDegree< T > & operator+= (const T &other)
 
constexpr BasicDegree< T > & operator-= (const BasicDegree< T > &other)
 
constexpr BasicDegree< T > & operator-= (const T &other)
 
constexpr BasicDegree< T > & operator*= (const BasicDegree< T > &other)
 
constexpr BasicDegree< T > & operator*= (const T &other)
 
constexpr BasicDegree< T > & operator/= (const BasicDegree< T > &other)
 
constexpr BasicDegree< T > & operator/= (const T &other)
 
constexpr BasicDegree< T > operator+ (const BasicDegree< T > &left, const BasicDegree< T > &right)
 
constexpr BasicDegree< T > operator- (const BasicDegree< T > &left, const BasicDegree< T > &right)
 
constexpr BasicDegree< T > operator* (const BasicDegree< T > &left, const BasicDegree< T > &right)
 
constexpr BasicDegree< T > operator/ (const BasicDegree< T > &left, const BasicDegree< T > &right)
 
constexpr BasicDegree< T > operator+ (const BasicDegree< T > &left, const T &right)
 
constexpr BasicDegree< T > operator- (const BasicDegree< T > &left, const T &right)
 
constexpr BasicDegree< T > operator* (const BasicDegree< T > left, const T &right)
 
constexpr BasicDegree< T > operator/ (const BasicDegree< T > &left, const T &right)
 
constexpr BasicDegree< T > operator- (const BasicDegree< T > &input)
 

Detailed Description

template<std::floating_point T>
class Math::BasicDegree< T >

Class that stores its units in degrees

This class exists to try to make it more obviously known what the units are that are being constructed and passed around.

This class is mainly for displaying underlying angular units and therefore attempts have been made to make it easy to convert from Degree to Radian and vice versa.

See also
Degree Literals for convenient user-defined literals.

Definition at line 261 of file Angle.hpp.

Member Typedef Documentation

◆ value_type

template<std::floating_point T>
using value_type = T

The underlying implementation type.

Definition at line 267 of file Angle.hpp.

Constructor & Destructor Documentation

◆ BasicDegree() [1/3]

template<std::floating_point T>
constexpr BasicDegree ( )
constexprdefault

Defaults to 0.

◆ BasicDegree() [2/3]

template<std::floating_point T>
constexpr BasicDegree ( T  value)
inlineconstexpr

Definition at line 274 of file Angle.hpp.

◆ BasicDegree() [3/3]

template<std::floating_point T>
constexpr BasicDegree ( const BasicRadian< T > &  value)
inlineconstexpr

Definition at line 275 of file Angle.hpp.

Member Function Documentation

◆ isInf()

template<std::floating_point T>
constexpr bool isInf ( ) const
inlineconstexpr

Definition at line 379 of file Angle.hpp.

◆ isNaN()

template<std::floating_point T>
constexpr bool isNaN ( ) const
inlineconstexpr

Definition at line 374 of file Angle.hpp.

◆ modulo()

template<std::floating_point T>
constexpr BasicDegree< T > modulo ( ) const
inlineconstexpr

Definition at line 363 of file Angle.hpp.

◆ modulus()

template<std::floating_point T>
static constexpr T modulus ( )
inlinestaticconstexpr

Definition at line 362 of file Angle.hpp.

◆ operator BasicRadian< T >()

template<std::floating_point T>
operator BasicRadian< T > ( ) const
inline

Definition at line 281 of file Angle.hpp.

◆ operator*=() [1/2]

template<std::floating_point T>
constexpr BasicDegree< T > & operator*= ( const BasicDegree< T > &  other)
inlineconstexpr

Definition at line 323 of file Angle.hpp.

◆ operator*=() [2/2]

template<std::floating_point T>
constexpr BasicDegree< T > & operator*= ( const T &  other)
inlineconstexpr

Definition at line 329 of file Angle.hpp.

◆ operator+=() [1/2]

template<std::floating_point T>
constexpr BasicDegree< T > & operator+= ( const BasicDegree< T > &  other)
inlineconstexpr

Definition at line 299 of file Angle.hpp.

◆ operator+=() [2/2]

template<std::floating_point T>
constexpr BasicDegree< T > & operator+= ( const T &  other)
inlineconstexpr

Definition at line 305 of file Angle.hpp.

◆ operator-=() [1/2]

template<std::floating_point T>
constexpr BasicDegree< T > & operator-= ( const BasicDegree< T > &  other)
inlineconstexpr

Definition at line 311 of file Angle.hpp.

◆ operator-=() [2/2]

template<std::floating_point T>
constexpr BasicDegree< T > & operator-= ( const T &  other)
inlineconstexpr

Definition at line 317 of file Angle.hpp.

◆ operator/=() [1/2]

template<std::floating_point T>
constexpr BasicDegree< T > & operator/= ( const BasicDegree< T > &  other)
inlineconstexpr

Definition at line 335 of file Angle.hpp.

◆ operator/=() [2/2]

template<std::floating_point T>
constexpr BasicDegree< T > & operator/= ( const T &  other)
inlineconstexpr

Definition at line 341 of file Angle.hpp.

◆ value()

template<std::floating_point T>
T value ( ) const
inline

Definition at line 293 of file Angle.hpp.

◆ zero()

template<std::floating_point T>
static constexpr BasicDegree< T > zero ( )
inlinestaticconstexpr

Definition at line 287 of file Angle.hpp.

Friends And Related Symbol Documentation

◆ operator* [1/2]

template<std::floating_point T>
constexpr BasicDegree< T > operator* ( const BasicDegree< T > &  left,
const BasicDegree< T > &  right 
)
friend

Definition at line 428 of file Angle.hpp.

◆ operator* [2/2]

template<std::floating_point T>
constexpr BasicDegree< T > operator* ( const BasicDegree< T >  left,
const T &  right 
)
friend

Definition at line 448 of file Angle.hpp.

◆ operator+ [1/2]

template<std::floating_point T>
constexpr BasicDegree< T > operator+ ( const BasicDegree< T > &  left,
const BasicDegree< T > &  right 
)
friend

Definition at line 418 of file Angle.hpp.

◆ operator+ [2/2]

template<std::floating_point T>
constexpr BasicDegree< T > operator+ ( const BasicDegree< T > &  left,
const T &  right 
)
friend

Definition at line 438 of file Angle.hpp.

◆ operator- [1/3]

template<std::floating_point T>
constexpr BasicDegree< T > operator- ( const BasicDegree< T > &  input)
friend

Definition at line 458 of file Angle.hpp.

◆ operator- [2/3]

template<std::floating_point T>
constexpr BasicDegree< T > operator- ( const BasicDegree< T > &  left,
const BasicDegree< T > &  right 
)
friend

Definition at line 423 of file Angle.hpp.

◆ operator- [3/3]

template<std::floating_point T>
constexpr BasicDegree< T > operator- ( const BasicDegree< T > &  left,
const T &  right 
)
friend

Definition at line 443 of file Angle.hpp.

◆ operator/ [1/2]

template<std::floating_point T>
constexpr BasicDegree< T > operator/ ( const BasicDegree< T > &  left,
const BasicDegree< T > &  right 
)
friend

Definition at line 433 of file Angle.hpp.

◆ operator/ [2/2]

template<std::floating_point T>
constexpr BasicDegree< T > operator/ ( const BasicDegree< T > &  left,
const T &  right 
)
friend

Definition at line 453 of file Angle.hpp.

◆ operator<=>

template<std::floating_point T>
constexpr auto operator<=> ( const BasicDegree< T > &  left,
const BasicDegree< T > &  right 
)
friend

Define the spaceship operator

Note
We define ONLY the <=> in order to get all six of the relational operators (C++20).

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