CVB++ 14.1
Angle Class Referencefinal

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...
 
Angleoperator+= (const Angle &angle) noexcept
 Adds and assigns to this angle. More...
 
Angleoperator-= (const Angle &angle) noexcept
 Subtracts and assigns to this angle. More...
 
Angleoperator*= (const double &value) noexcept
 Multiplies this angle with the given value. More...
 
Angleoperator/= (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...
 

Detailed Description

Object for convenient and type - safe handling of angles.

Constructor & Destructor Documentation

◆ Angle()

Angle ( bool  trim = false)
inlineexplicitnoexcept

Generate a 0° angle.

Parameters
[in]trimEnable trimming of values between -PI...PI.
Exceptions
Doesnot throw any exception.

Member Function Documentation

◆ Deg()

double Deg ( ) const
inlinenoexcept

Get the value in degrees.

Returns
The value in degrees.
Exceptions
Doesnot throw any exception.
Examples
ShapeFinder2/QtShapeFinder2, and ShapeFinder2/QtShapeFinder2Cuda.

◆ FromDegrees()

static Angle FromDegrees ( double  deg,
bool  trim = false 
)
inlinestaticnoexcept

Create an angle in degrees.

Parameters
[in]degAngle value.
[in]trimEnable trimming of values between -PI...PI.
Returns
New angle object representing the input value.
Exceptions
Doesnot throw any exception.

◆ FromRadians()

static Angle FromRadians ( double  rad,
bool  trim = false 
)
inlinestaticnoexcept

Create an angle in radians.

Parameters
[in]radAngle value.
[in]trimEnable trimming of values between -PI...PI.
Returns
New angle object representing the input value.
Exceptions
Doesnot throw any exception.

◆ IsTrimmed()

bool IsTrimmed ( ) const
inlinenoexcept

Get trimming of the angle's value to the range -PI...PI.

Returns
True if trimming is on, false otherwise.
Exceptions
Doesnot throw any exception.

◆ operator!=()

bool operator!= ( const Angle angle) const
inlinenoexcept

Compares to an other angle.

Parameters
[in]angleOther angle.
Returns
True if not equal, otherwise false.
Exceptions
Doesnot throw any exception.

◆ operator*=()

Angle & operator*= ( const double &  value)
inlinenoexcept

Multiplies this angle with the given value.

Parameters
[in]valueFactor.
Returns
This angle.
Exceptions
Doesnot throw any exception.

◆ operator+=()

Angle & operator+= ( const Angle angle)
inlinenoexcept

Adds and assigns to this angle.

Parameters
[in]angleOther angle.
Returns
This angle.
Exceptions
Doesnot throw any exception.

◆ operator-=()

Angle & operator-= ( const Angle angle)
inlinenoexcept

Subtracts and assigns to this angle.

Parameters
[in]angleOther angle.
Returns
This angle.
Exceptions
Doesnot throw any exception.

◆ operator/=()

Angle & operator/= ( const double &  value)
inlinenoexcept

Divides this angle by the given value.

Parameters
[in]valueDivisor.
Returns
This angle.
Exceptions
Doesnot throw any exception.

◆ operator<()

bool operator< ( const Angle angle) const
inlinenoexcept

Compares to an other angle.

Parameters
[in]angleOther angle.
Returns
True if this less than the other angle, otherwise false.
Exceptions
Doesnot throw any exception.

◆ operator<=()

bool operator<= ( const Angle angle) const
inlinenoexcept

Compares to an other angle.

Parameters
[in]angleOther angle.
Returns
True if this less than or equal the other angle, otherwise false.
Exceptions
Doesnot throw any exception.

◆ operator==()

bool operator== ( const Angle angle) const
inlinenoexcept

Compares to an other angle.

Parameters
[in]angleOther angle.
Returns
True if equal, otherwise false.
Exceptions
Doesnot throw any exception.

◆ operator>()

bool operator> ( const Angle angle) const
inlinenoexcept

Compares to an other angle.

Parameters
[in]angleOther angle.
Returns
True if this greater than the other angle, otherwise false.
Exceptions
Doesnot throw any exception.

◆ operator>=()

bool operator>= ( const Angle angle) const
inlinenoexcept

Compares to an other angle.

Parameters
[in]angleOther angle.
Returns
True if this greater than or equal the other angle, otherwise false.
Exceptions
Doesnot throw any exception.

◆ Rad()

double Rad ( ) const
inlinenoexcept

Get the value in radians.

Returns
The value in radians.
Exceptions
Doesnot throw any exception.

◆ SetDeg()

void SetDeg ( double  deg)
inlinenoexcept

Set the value in degrees.

Parameters
[in]degNew value.
Exceptions
Doesnot throw any exception.

◆ SetIsTrimmed()

void SetIsTrimmed ( bool  trim)
inlinenoexcept

Set trimming of the value of the angle to the range -PI...PI.

Parameters
[in]trimTrue to turn trimming on, false otherwise.
Exceptions
Doesnot throw any exception.

◆ SetRad()

void SetRad ( double  rad)
inlinenoexcept

Set the value in radians.

Parameters
[in]radNew value.
Exceptions
Doesnot throw any exception.

Friends And Related Function Documentation

◆ Abs()

Angle Abs ( Angle  angle)
related

Absolute value of an angle.

Parameters
[in]angleThe angle.
Returns
Absolute value.
Exceptions
Doesnot throw any exception.

◆ Acos()

Angle Acos ( double  d)
related

Returns the angle whose cosine is the specified number.

Parameters
[in]dCosine.
Returns
Result angle.
Exceptions
Doesnot throw any exception.

◆ Asin()

Angle Asin ( double  d)
related

Returns the angle whose sine is the specified number.

Parameters
[in]dSine.
Returns
Result angle.
Exceptions
Doesnot throw any exception.

◆ Atan()

Angle Atan ( double  d)
related

Returns the angle whose tangent is the specified number.

Parameters
[in]dTangent.
Returns
Result angle.
Exceptions
Doesnot throw any exception.

◆ Atan2()

Angle Atan2 ( double  y,
double  x 
)
related

Returns the angle whose tangent is the quotient of two specified numbers.

Parameters
[in]yY parameter.
[in]xX parameter.
Returns
Result angle.
Exceptions
Doesnot throw any exception.

◆ Cos()

double Cos ( Angle  angle)
related

Returns the cosine of an angle.

Parameters
[in]angleThe angle.
Returns
The cosine.
Exceptions
Doesnot throw any exception.

◆ Cosh()

double Cosh ( Angle  angle)
related

Returns the hyperbolic cosine of an angle.

Parameters
[in]angleThe angle.
Returns
The hyperbolic cosine.
Exceptions
Doesnot throw any exception.

◆ Max()

Angle Max ( Angle  a,
Angle  b 
)
related

Returns the bigger of two angles.

Parameters
[in]aFirst angle.
[in]bSecond angle.
Returns
Biggest angle.
Exceptions
Doesnot throw any exception.
Examples
Cvb/CppPointCloudCreateCalibrated.

◆ Min()

Angle Min ( Angle  a,
Angle  b 
)
related

Returns the smaller of two angles.

Parameters
[in]aFirst angle.
[in]bSecond angle.
Returns
Smallest angle.
Exceptions
Doesnot throw any exception.

◆ operator*() [1/2]

Angle operator* ( const Angle lhs,
const double &  rhs 
)
related

Multiplies an angle with a value.

Parameters
[in]lhsRight hand side angle.
[in]rhsLeft hand side value.
Returns
The computation result.
Exceptions
Doesnot throw any exception.

◆ operator*() [2/2]

Angle operator* ( const double &  lhs,
const Angle rhs 
)
related

Multiplies value with an angle.

Parameters
[in]lhsRight hand side value.
[in]rhsLeft hand side angle.
Returns
The computation result.
Exceptions
Doesnot throw any exception.

◆ operator+()

Angle operator+ ( const Angle lhs,
const Angle rhs 
)
related

Add two angles.

Parameters
[in]lhsRight hand side angle.
[in]rhsLeft hand side angle.
Returns
The computation result.
Exceptions
Doesnot throw any exception.

◆ operator-()

Angle operator- ( const Angle lhs,
const Angle rhs 
)
related

Subtract two angles.

Parameters
[in]lhsRight hand side angle.
[in]rhsLeft hand side angle.
Returns
The computation result.
Exceptions
Doesnot throw any exception.

◆ operator/()

Angle operator/ ( const Angle lhs,
const double &  rhs 
)
related

Divides an angle by a value.

Parameters
[in]lhsRight hand side angle.
[in]rhsLeft hand side value.
Returns
The computation result.
Exceptions
Doesnot throw any exception.

◆ Sign()

int Sign ( Angle  angle)
related

Returns a value indicating the sign of an Angle.

Parameters
[in]angleThe angle.
Returns
-1 if angle is less than zero, 0 if angle is zero, 1 if angle is greater than zero.
Exceptions
Doesnot throw any exception.

◆ Sin()

double Sin ( Angle  angle)
related

Returns the sine of an angle.

Parameters
[in]angleThe angle.
Returns
The sine.
Exceptions
Doesnot throw any exception.

◆ Sinh()

double Sinh ( Angle  angle)
related

Returns the hyperbolic sine of an angle.

Parameters
[in]angleThe angle.
Returns
The hyperbolic sine.
Exceptions
Doesnot throw any exception.

◆ Tan()

double Tan ( Angle  angle)
related

Returns the tangent of an angle.

Parameters
[in]angleThe angle.
Returns
The tangent.
Exceptions
Doesnot throw any exception.

◆ Tanh()

double Tanh ( Angle  angle)
related

Returns the hyperbolic tangent of an angle.

Parameters
[in]angleThe angle.
Returns
The hyperbolic tangent.
Exceptions
Doesnot throw any exception.