Object for convenient and type - safe handling of angles. More...
#include <cvb/angle.hpp>
Public Member Functions | |
Angle (bool trim=false) noexcept | |
Generate a 0° angle. More... | |
double | Rad () const noexcept |
Get the value in radians. More... | |
void | SetRad (double rad) noexcept |
Set the value in radians. More... | |
double | Deg () const noexcept |
Get the value in degrees. More... | |
void | SetDeg (double deg) noexcept |
Set the value in degrees. More... | |
bool | IsTrimmed () const noexcept |
Get trimming of the angle's value to the range -PI...PI. More... | |
void | SetIsTrimmed (bool trim) noexcept |
Set trimming of the value of the angle to the range -PI...PI. More... | |
bool | operator== (const Angle &angle) const noexcept |
Compares to an other angle. More... | |
bool | operator!= (const Angle &angle) const noexcept |
Compares to an other angle. More... | |
bool | operator< (const Angle &angle) const noexcept |
Compares to an other angle. More... | |
bool | operator<= (const Angle &angle) const noexcept |
Compares to an other angle. More... | |
bool | operator> (const Angle &angle) const noexcept |
Compares to an other angle. More... | |
bool | operator>= (const Angle &angle) const noexcept |
Compares to an other angle. More... | |
Angle & | operator+= (const Angle &angle) noexcept |
Adds and assigns to this angle. More... | |
Angle & | operator-= (const Angle &angle) noexcept |
Subtracts and assigns to this angle. More... | |
Angle & | operator*= (const double &value) noexcept |
Multiplies this angle with the given value. More... | |
Angle & | operator/= (const double &value) noexcept |
Divides this angle by the given value. More... | |
Static Public Member Functions | |
static Angle | FromDegrees (double deg, bool trim=false) noexcept |
Create an angle in degrees. More... | |
static Angle | FromRadians (double rad, bool trim=false) noexcept |
Create an angle in radians. More... | |
Related Functions | |
(Note that these are not member functions.) | |
Angle | operator+ (const Angle &lhs, const Angle &rhs) |
Add two angles. More... | |
Angle | operator- (const Angle &lhs, const Angle &rhs) |
Subtract two angles. More... | |
Angle | operator/ (const Angle &lhs, const double &rhs) |
Divides an angle by a value. More... | |
Angle | operator* (const Angle &lhs, const double &rhs) |
Multiplies an angle with a value. More... | |
Angle | operator* (const double &lhs, const Angle &rhs) |
Multiplies value with an angle. More... | |
Angle | Abs (Angle angle) noexcept |
Absolute value of an angle. More... | |
Angle | Acos (double d) noexcept |
Returns the angle whose cosine is the specified number. More... | |
Angle | Asin (double d) noexcept |
Returns the angle whose sine is the specified number. More... | |
Angle | Atan (double d) noexcept |
Returns the angle whose tangent is the specified number. More... | |
Angle | Atan2 (double y, double x) noexcept |
Returns the angle whose tangent is the quotient of two specified numbers. More... | |
double | Cos (Angle angle) noexcept |
Returns the cosine of an angle. More... | |
double | Cosh (Angle angle) noexcept |
Returns the hyperbolic cosine of an angle. More... | |
double | Sin (Angle angle) noexcept |
Returns the sine of an angle. More... | |
double | Sinh (Angle angle) noexcept |
Returns the hyperbolic sine of an angle. More... | |
double | Tan (Angle angle) noexcept |
Returns the tangent of an angle. More... | |
double | Tanh (Angle angle) noexcept |
Returns the hyperbolic tangent of an angle. More... | |
int | Sign (Angle angle) noexcept |
Returns a value indicating the sign of an Angle. More... | |
Angle | Max (Angle a, Angle b) noexcept |
Returns the bigger of two angles. More... | |
Angle | Min (Angle a, Angle b) noexcept |
Returns the smaller of two angles. More... | |
Object for convenient and type - safe handling of angles.
|
inlineexplicitnoexcept |
Generate a 0° angle.
[in] | trim | Enable trimming of values between -PI...PI. |
Does | not throw any exception. |
|
inlinenoexcept |
Get the value in degrees.
Does | not throw any exception. |
|
inlinestaticnoexcept |
Create an angle in degrees.
[in] | deg | Angle value. |
[in] | trim | Enable trimming of values between -PI...PI. |
Does | not throw any exception. |
|
inlinestaticnoexcept |
Create an angle in radians.
[in] | rad | Angle value. |
[in] | trim | Enable trimming of values between -PI...PI. |
Does | not throw any exception. |
|
inlinenoexcept |
Get trimming of the angle's value to the range -PI...PI.
Does | not throw any exception. |
|
inlinenoexcept |
Compares to an other angle.
[in] | angle | Other angle. |
Does | not throw any exception. |
|
inlinenoexcept |
Multiplies this angle with the given value.
[in] | value | Factor. |
Does | not throw any exception. |
Adds and assigns to this angle.
[in] | angle | Other angle. |
Does | not throw any exception. |
Subtracts and assigns to this angle.
[in] | angle | Other angle. |
Does | not throw any exception. |
|
inlinenoexcept |
Divides this angle by the given value.
[in] | value | Divisor. |
Does | not throw any exception. |
|
inlinenoexcept |
Compares to an other angle.
[in] | angle | Other angle. |
Does | not throw any exception. |
|
inlinenoexcept |
Compares to an other angle.
[in] | angle | Other angle. |
Does | not throw any exception. |
|
inlinenoexcept |
Compares to an other angle.
[in] | angle | Other angle. |
Does | not throw any exception. |
|
inlinenoexcept |
Compares to an other angle.
[in] | angle | Other angle. |
Does | not throw any exception. |
|
inlinenoexcept |
Compares to an other angle.
[in] | angle | Other angle. |
Does | not throw any exception. |
|
inlinenoexcept |
Get the value in radians.
Does | not throw any exception. |
|
inlinenoexcept |
Set the value in degrees.
[in] | deg | New value. |
Does | not throw any exception. |
|
inlinenoexcept |
Set trimming of the value of the angle to the range -PI...PI.
[in] | trim | True to turn trimming on, false otherwise. |
Does | not throw any exception. |
|
inlinenoexcept |
Set the value in radians.
[in] | rad | New value. |
Does | not throw any exception. |
Absolute value of an angle.
[in] | angle | The angle. |
Does | not throw any exception. |
|
related |
Returns the angle whose cosine is the specified number.
[in] | d | Cosine. |
Does | not throw any exception. |
|
related |
Returns the angle whose sine is the specified number.
[in] | d | Sine. |
Does | not throw any exception. |
|
related |
Returns the angle whose tangent is the specified number.
[in] | d | Tangent. |
Does | not throw any exception. |
|
related |
Returns the angle whose tangent is the quotient of two specified numbers.
[in] | y | Y parameter. |
[in] | x | X parameter. |
Does | not throw any exception. |
|
related |
Returns the cosine of an angle.
[in] | angle | The angle. |
Does | not throw any exception. |
|
related |
Returns the hyperbolic cosine of an angle.
[in] | angle | The angle. |
Does | not throw any exception. |
Returns the bigger of two angles.
[in] | a | First angle. |
[in] | b | Second angle. |
Does | not throw any exception. |
Returns the smaller of two angles.
[in] | a | First angle. |
[in] | b | Second angle. |
Does | not throw any exception. |
Multiplies an angle with a value.
[in] | lhs | Right hand side angle. |
[in] | rhs | Left hand side value. |
Does | not throw any exception. |
Multiplies value with an angle.
[in] | lhs | Right hand side value. |
[in] | rhs | Left hand side angle. |
Does | not throw any exception. |
Add two angles.
[in] | lhs | Right hand side angle. |
[in] | rhs | Left hand side angle. |
Does | not throw any exception. |
Subtract two angles.
[in] | lhs | Right hand side angle. |
[in] | rhs | Left hand side angle. |
Does | not throw any exception. |
Divides an angle by a value.
[in] | lhs | Right hand side angle. |
[in] | rhs | Left hand side value. |
Does | not throw any exception. |
|
related |
Returns a value indicating the sign of an Angle.
[in] | angle | The angle. |
Does | not throw any exception. |
|
related |
Returns the sine of an angle.
[in] | angle | The angle. |
Does | not throw any exception. |
|
related |
Returns the hyperbolic sine of an angle.
[in] | angle | The angle. |
Does | not throw any exception. |
|
related |
Returns the tangent of an angle.
[in] | angle | The angle. |
Does | not throw any exception. |
|
related |
Returns the hyperbolic tangent of an angle.
[in] | angle | The angle. |
Does | not throw any exception. |