DUNE: Uniform Navigational Environment  2022.04.1
DUNE::Math::Angles Class Reference

Detailed Description

Angle manipulation and conversion methods.

Static Public Member Functions

static fp64_t normalizeRadian (fp64_t a)
 
static fp64_t radians (fp64_t d)
 
static fp64_t degrees (fp64_t r)
 
static fp64_t convertDMSToDecimal (int degrees, int minutes, int seconds)
 
static fp64_t convertDMSToDecimal (int degrees, double minutes)
 
static void convertDecimalToDMS (double value, int &degrees, int &minutes, double &seconds)
 
static void convertDecimalToDM (double value, int &degrees, double &minutes)
 
static void rotate (double angle, bool clockwise, double &x, double &y)
 
static fp64_t minSignedAngle (fp64_t source, fp64_t target)
 

Member Function Documentation

◆ convertDecimalToDM()

static void DUNE::Math::Angles::convertDecimalToDM ( double  value,
int &  degrees,
double &  minutes 
)
inlinestatic

Convert decimal degrees to Degrees, Minutes.

Parameters
valuedegrees in decimal format.
degreescomputed degrees.
minutescomputed minutes.

Referenced by DUNE::Coordinates::latitudeToNMEA(), and DUNE::Coordinates::longitudeToNMEA().

◆ convertDecimalToDMS()

static void DUNE::Math::Angles::convertDecimalToDMS ( double  value,
int &  degrees,
int &  minutes,
double &  seconds 
)
inlinestatic

Convert decimal degrees to Degrees, Minutes, Seconds.

Parameters
valuedegrees in decimal format.
degreescomputed degrees.
minutescomputed minutes.
secondscomputed seconds.

◆ convertDMSToDecimal() [1/2]

static fp64_t DUNE::Math::Angles::convertDMSToDecimal ( int  degrees,
int  minutes,
int  seconds 
)
inlinestatic

Convert Degrees, Minutes, Seconds to Decimal Format.

Parameters
degreesdegrees.
minutesminutes.
secondsseconds.
Returns
degrees in decimal format.

Referenced by DUNE::Coordinates::NMEAToLatitude(), and DUNE::Coordinates::NMEAToLongitude().

◆ convertDMSToDecimal() [2/2]

static fp64_t DUNE::Math::Angles::convertDMSToDecimal ( int  degrees,
double  minutes 
)
inlinestatic

Convert Degrees, Minutes to Decimal Format.

Parameters
degreesdegrees.
minutesminutes.
Returns
degrees in decimal format.

◆ degrees()

◆ minSignedAngle()

static fp64_t DUNE::Math::Angles::minSignedAngle ( fp64_t  source,
fp64_t  target 
)
inlinestatic

Computes the smallest signed angle between two angles (radians).

Parameters
sourcereference angle.
targettarget angle.
Returns
smallest signed angle.

Referenced by DUNE::Navigation::BasicNavigation::consume().

◆ normalizeRadian()

static fp64_t DUNE::Math::Angles::normalizeRadian ( fp64_t  a)
inlinestatic

◆ radians()

◆ rotate()

static void DUNE::Math::Angles::rotate ( double  angle,
bool  clockwise,
double &  x,
double &  y 
)
inlinestatic

XY Coordinate conversion considering a rotation angle.

Parameters
[in]angleangle in radian.
[in]clockwisetrue for a clockwise rotation, false for counterclockwise.
[in,out]xoriginal x value on entry, rotated x value on exit.
[in,out]yoriginal y value on entry, rotated y value on exit.
Author
Eduardo Marques

Referenced by DUNE::Maneuvers::RowsStages::getDistance(), and DUNE::Maneuvers::RowsStages::RowsStages().

Collaboration diagram for DUNE::Math::Angles:
Collaboration graph