Lums
Public Member Functions | Static Public Member Functions | List of all members
lm::Angle Class Reference

A class used to represent arbitrary angles. More...

#include <Angle.hpp>

Public Member Functions

constexpr Angle ()
 
constexpr Angle (double angle)
 
constexpr bool operator== (const Angle &rhs) const
 
constexpr bool operator!= (const Angle &rhs) const
 
constexpr bool operator< (const Angle &rhs) const
 
constexpr bool operator> (const Angle &rhs) const
 
constexpr bool operator<= (const Angle &rhs) const
 
constexpr bool operator>= (const Angle &rhs) const
 
constexpr Angle operator- () const
 
constexpr Angle operator+ () const
 
Angleoperator+= (const Angle &rhs)
 
Angleoperator-= (const Angle &rhs)
 
Angleoperator*= (double rhs)
 
Angleoperator/= (double rhs)
 
Angle operator+ (const Angle &rhs) const
 
Angle operator- (const Angle &rhs) const
 
Angle operator* (double rhs) const
 
Angle operator/ (double rhs) const
 
constexpr double toTurns () const
 
constexpr double toRadians () const
 
constexpr double toDegrees () const
 
double sin () const
 
double cos () const
 
double tan () const
 

Static Public Member Functions

static constexpr Angle turns (double angle)
 
static constexpr Angle radians (double angle)
 
static constexpr Angle degrees (double angle)
 

Detailed Description

A class used to represent arbitrary angles.

Constructor & Destructor Documentation

constexpr lm::Angle::Angle ( )
inline

Create a null angle.

constexpr lm::Angle::Angle ( double  angle)
inlineexplicit

Create an angle in turns. This is the same as lm::Angle::Turns

Parameters
angleAn angle in turns.
Returns
The resulting Angle.

Member Function Documentation

double lm::Angle::cos ( ) const
inline

Get the cosinus of the angle.

Returns
the cosinus of the angle.
static constexpr Angle lm::Angle::degrees ( double  angle)
inlinestatic

Create an angle from degrees.

Parameters
angleAngle in degrees.
Returns
A new angle with the corresponding value.
constexpr bool lm::Angle::operator!= ( const Angle rhs) const
inline

Return false if and only if the two angles are equals.

Parameters
rhsThe angle to be compared.
Returns
True if the angles are not equal, false otherwise.
Angle lm::Angle::operator* ( double  rhs) const
inline

Multiply an angle, and returns a copy of the result.

Parameters
rhsA coefficient.
Returns
A new angle, resulting of the product.
Angle& lm::Angle::operator*= ( double  rhs)
inline

Multiply an angle with a coefficient.

Parameters
rhsA coefficient.
Returns
This angle.
constexpr Angle lm::Angle::operator+ ( ) const
inline

Return the same angle.

Returns
The same angle.
Angle lm::Angle::operator+ ( const Angle rhs) const
inline

Add an angle, and returns a copy of the result.

Parameters
rhsThe angle to be added.
Returns
A new angle, resulting of the sum.
Angle& lm::Angle::operator+= ( const Angle rhs)
inline

Add an angle.

Parameters
rhsThe angle to be added.
Returns
This angle.
constexpr Angle lm::Angle::operator- ( ) const
inline

Return the opposite of an angle.

Returns
The opposite of the angle.
Angle lm::Angle::operator- ( const Angle rhs) const
inline

Substract an angle, and returns a copy of the result.

Parameters
rhsThe angle to be substracted.
Returns
A new angle, resulting of the difference.
Angle& lm::Angle::operator-= ( const Angle rhs)
inline

Substract an angle.

Parameters
rhsThe angle to be substracted.
Returns
This angle.
Angle lm::Angle::operator/ ( double  rhs) const
inline

Divide an angle, and returns a copy of the result.

Parameters
rhsA coefficient.
Returns
A new angle, resulting of the division.
Angle& lm::Angle::operator/= ( double  rhs)
inline

Divide an angle with a coefficient.

Parameters
rhsA coefficient.
Returns
This angle.
constexpr bool lm::Angle::operator< ( const Angle rhs) const
inline

Inferior than operator.

Parameters
rhsThe angle to be compared.
Returns
True if the first angle is inferior to the second one, false otherwise.
constexpr bool lm::Angle::operator<= ( const Angle rhs) const
inline

Inferior or equal operator.

Parameters
rhsThe angle to be compared.
Returns
True if the first angle is inferior or equal to the second one, false otherwise.
constexpr bool lm::Angle::operator== ( const Angle rhs) const
inline

Return true if and only if the two angles are equals.

Parameters
rhsThe angle to be compared.
Returns
True if the angles are equal, false otherwise.
constexpr bool lm::Angle::operator> ( const Angle rhs) const
inline

Superior than operator.

Parameters
rhsThe angle to be compared.
Returns
True if the first angle is superior to the second one, false otherwise.
constexpr bool lm::Angle::operator>= ( const Angle rhs) const
inline

Superior or equal operator.

Parameters
rhsThe angle to be compared.
Returns
True if the first angle is superior or equal to the second one, false otherwise.
static constexpr Angle lm::Angle::radians ( double  angle)
inlinestatic

Create an angle from radians.

Parameters
angleAngle in radians.
Returns
A new angle with the corresponding value.
double lm::Angle::sin ( ) const
inline

Get the sinus of the angle.

Returns
the sinus of the angle.
double lm::Angle::tan ( ) const
inline

Get the tangent of the angle.

Returns
the tangent of the angle.
constexpr double lm::Angle::toDegrees ( ) const
inline

Get the angle value in degrees.

Returns
Angle value in degrees
constexpr double lm::Angle::toRadians ( ) const
inline

Get the angle value in radians.

Returns
Angle value in radians
constexpr double lm::Angle::toTurns ( ) const
inline

Get the angle value in turns.

Returns
Angle value in turns.
static constexpr Angle lm::Angle::turns ( double  angle)
inlinestatic

Create an angle from turns.

Parameters
angleAngle in turns
Returns
A new angle with the corresponding value.

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