LuciadCPillar 2024.0.08
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
luciad::Angle Struct Referencefinal

An angle on a mathematical circle: degrees, counter-clockwise from right/X-axis. More...

#include <luciad/cartesian/Angle.h>

Public Types

enum class  Direction { Clockwise , CounterClockwise }
 Represents the different angular directions. More...
 

Public Member Functions

 Angle (const Angle &angle)=default
 Creates an angle based on another angle. More...
 
 Angle (const Azimuth &azimuth)
 Creates an angle based on an azimuth, expressed in degrees. More...
 
 Angle (double degrees)
 Creates an angle based on the given angular value in degrees. More...
 
double getDegrees () const
 Returns the value in degrees constrained between [0, 360]. More...
 
double getRadians () const
 Returns the value in radians constrained between [0, 2*PI] More...
 
bool operator!= (const Angle &other) const
 
Angle operator* (const double scalar) const
 
Angleoperator*= (const double scalar)
 
Angle operator+ (const Angle &other) const
 
Angleoperator+= (const Angle &other)
 
Angle operator- () const
 
Angle operator- (const Angle &other) const
 
Angleoperator-= (const Angle &other)
 
Angle operator/ (const double scalar) const
 
Angleoperator/= (const double scalar)
 
bool operator< (const Angle &other) const
 
bool operator<= (const Angle &other) const
 
Angleoperator= (const Angle &other)=default
 
Angleoperator= (const Azimuth &other)
 
Angleoperator= (const double arg) noexcept
 
bool operator== (const Angle &other) const
 
bool operator> (const Angle &other) const
 
bool operator>= (const Angle &other) const
 

Static Public Member Functions

static Angle fromRadians (double radians)
 Creates an Angle from an angle value in radians. More...
 
static double normalize (double degrees)
 Normalizes the degree value to the range ]-180, +180]. More...
 

Detailed Description

An angle on a mathematical circle: degrees, counter-clockwise from right/X-axis.

Member Enumeration Documentation

◆ Direction

enum class luciad::Angle::Direction
strong

Represents the different angular directions.

Enumerator
Clockwise 

Angle in clockwise direction.

CounterClockwise 

Angle in counter-clockwise direction.

Constructor & Destructor Documentation

◆ Angle() [1/3]

luciad::Angle::Angle ( double  degrees)

Creates an angle based on the given angular value in degrees.

Parameters
degreesan angle in degree
Exceptions
luciad::InvalidArgumentExceptionwhen degrees is NaN or infinite.

◆ Angle() [2/3]

luciad::Angle::Angle ( const Angle angle)
default

Creates an angle based on another angle.

Parameters
anglean angle.

◆ Angle() [3/3]

luciad::Angle::Angle ( const Azimuth azimuth)

Creates an angle based on an azimuth, expressed in degrees.

Parameters
azimuthan azimuth.

Member Function Documentation

◆ fromRadians()

static Angle luciad::Angle::fromRadians ( double  radians)
static

Creates an Angle from an angle value in radians.

Parameters
radiansan angle in radians
Returns
a new angle based on the given angle in radians
Exceptions
luciad::InvalidArgumentExceptionwhen radians is NaN or infinite.

◆ getDegrees()

double luciad::Angle::getDegrees ( ) const
inline

Returns the value in degrees constrained between [0, 360].

Returns
the value in degrees constrained between [0, 360].

◆ getRadians()

double luciad::Angle::getRadians ( ) const

Returns the value in radians constrained between [0, 2*PI]

Returns
the value in radians constrained between [0, 2*PI].

◆ normalize()

static double luciad::Angle::normalize ( double  degrees)
static

Normalizes the degree value to the range ]-180, +180].

Parameters
degreesa value in degrees
Returns
a degrees value, normalized to ]-180, +180].

◆ operator!=()

bool luciad::Angle::operator!= ( const Angle other) const
inline

◆ operator*()

Angle luciad::Angle::operator* ( const double  scalar) const
inline

◆ operator*=()

Angle & luciad::Angle::operator*= ( const double  scalar)
inline

◆ operator+()

Angle luciad::Angle::operator+ ( const Angle other) const
inline

◆ operator+=()

Angle & luciad::Angle::operator+= ( const Angle other)
inline

◆ operator-() [1/2]

Angle luciad::Angle::operator- ( ) const
inline

◆ operator-() [2/2]

Angle luciad::Angle::operator- ( const Angle other) const
inline

◆ operator-=()

Angle & luciad::Angle::operator-= ( const Angle other)
inline

◆ operator/()

Angle luciad::Angle::operator/ ( const double  scalar) const
inline

◆ operator/=()

Angle & luciad::Angle::operator/= ( const double  scalar)
inline

◆ operator<()

bool luciad::Angle::operator< ( const Angle other) const
inline

◆ operator<=()

bool luciad::Angle::operator<= ( const Angle other) const
inline

◆ operator=() [1/3]

Angle & luciad::Angle::operator= ( const Angle other)
default

◆ operator=() [2/3]

Angle & luciad::Angle::operator= ( const Azimuth other)

◆ operator=() [3/3]

Angle & luciad::Angle::operator= ( const double  arg)
inlinenoexcept

◆ operator==()

bool luciad::Angle::operator== ( const Angle other) const
inline

◆ operator>()

bool luciad::Angle::operator> ( const Angle other) const
inline

◆ operator>=()

bool luciad::Angle::operator>= ( const Angle other) const
inline