LIBRCSC Docs
Documentation for HELIOS's BASE LIBRCSC library for RoboCup 2D Simulation League.
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
rcsc::AngleDeg Class Reference

degree wrapper class More...

#include <angle_deg.h>

Public Member Functions

 AngleDeg ()
 default constructor.
 
 AngleDeg (const double deg)
 constructor with value. More...
 
const AngleDegoperator= (const double deg)
 operator substitution. More...
 
double degree () const
 get value of this angle More...
 
double abs () const
 get absolute value of this angle More...
 
double radian () const
 get RADIAN value. More...
 
AngleDeg operator- () const
 get new AngleDeg multiplyed by -1. More...
 
const AngleDegoperator+= (const AngleDeg &angle)
 operator += with AngleDeg More...
 
const AngleDegoperator+= (const double deg)
 operator += with double More...
 
const AngleDegoperator-= (const AngleDeg &angle)
 operator -= with AngleDeg More...
 
const AngleDegoperator-= (const double deg)
 operator -= with double More...
 
const AngleDegoperator*= (const double scalar)
 operator *= More...
 
const AngleDegoperator/= (const double scalar)
 operator /= More...
 
bool isLeftOf (const AngleDeg &angle) const
 check if this angle is left of 'angle' More...
 
bool isLeftEqualOf (const AngleDeg &angle) const
 check if this angle is left or equal of 'angle' More...
 
bool isRightOf (const AngleDeg &angle) const
 check if this angle is right of 'angle' More...
 
bool isRightEqualOf (const AngleDeg &angle) const
 check if this angle is right or equal of 'angle' More...
 
double cos () const
 calculate cosine More...
 
double sin () const
 calculate sine More...
 
double tan () const
 calculate tarngetn More...
 
bool isWithin (const AngleDeg &left, const AngleDeg &right) const
 check if this angle is within [left, right] (turn clockwise). More...
 
void sinMinMax (const double angle_err, double *minsin, double *maxsin) const
 calculate min/max sine value with angle error. More...
 
void cosMinMax (const double angle_err, double *mincos, double *maxcos) const
 calculate min/max cosine value of angle with angle error. More...
 
std::ostream & print (std::ostream &os) const
 output value to ostream More...
 
std::ostream & printRound (std::ostream &os, const double step=0.1) const
 output rounded value to ostream More...
 

Static Public Member Functions

static double normalize_angle (double dir)
 static utility. normalize angle More...
 
static double rad2deg (const double rad)
 static utility. convert radian to degree More...
 
static double deg2rad (const double deg)
 static utility. convert degree to radian More...
 
static double cos_deg (const double deg)
 static utility. calculate cosine value for degree angle More...
 
static double sin_deg (const double deg)
 static utility. calculate sine value for degree angle More...
 
static double tan_deg (const double deg)
 static utility. calculate tangent value for degree angle More...
 
static double acos_deg (const double cosine)
 static utility. calculate arc cosine value More...
 
static double asin_deg (const double sine)
 static utility. calculate arc sine value More...
 
static double atan_deg (const double tangent)
 static utility. calculate arc tangent value More...
 
static double atan2_deg (const double y, const double x)
 static utility. calculate arc tangent value from XY More...
 
static AngleDeg bisect (const AngleDeg &left, const AngleDeg &right)
 static utility that returns bisect angle of [left, right]. More...
 

Static Public Attributes

static const double EPSILON
 epsilon value
 
static const double PI
 pi valur
 
static const double TWO_PI
 2*pi valur
 
static const double DEG2RAD
 constant variable to convert DEGREE to RADIAN.
 
static const double RAD2DEG
 constant variable to convert RADIAN to DEGREE.
 

Detailed Description

degree wrapper class

Constructor & Destructor Documentation

◆ AngleDeg()

rcsc::AngleDeg::AngleDeg ( const double  deg)
inline

constructor with value.

NO explicit. This means that we can use this class as follows. AngleDeg angle = 3.0;

Member Function Documentation

◆ abs()

double rcsc::AngleDeg::abs ( ) const
inline

get absolute value of this angle

Returns
absolute value of degree()

◆ acos_deg()

static double rcsc::AngleDeg::acos_deg ( const double  cosine)
inlinestatic

static utility. calculate arc cosine value

Parameters
cosinecosine value
Returns
arc cosine value, that is degree type.

◆ asin_deg()

static double rcsc::AngleDeg::asin_deg ( const double  sine)
inlinestatic

static utility. calculate arc sine value

Parameters
sinesine value
Returns
arc sine value, that is degree type.

◆ atan2_deg()

static double rcsc::AngleDeg::atan2_deg ( const double  y,
const double  x 
)
inlinestatic

static utility. calculate arc tangent value from XY

Parameters
ycoordinate Y
xcoordinate X
Returns
arc tangent value, that is degree type.

◆ atan_deg()

static double rcsc::AngleDeg::atan_deg ( const double  tangent)
inlinestatic

static utility. calculate arc tangent value

Parameters
tangenttangent value
Returns
arc tangent value, that is degree.

◆ bisect()

static AngleDeg rcsc::AngleDeg::bisect ( const AngleDeg left,
const AngleDeg right 
)
static

static utility that returns bisect angle of [left, right].

Parameters
leftleft start angle
rightright end angle
Returns
bisect angle

this methid can take obtuse angle.

◆ cos()

double rcsc::AngleDeg::cos ( ) const
inline

calculate cosine

Returns
cosine value

◆ cos_deg()

static double rcsc::AngleDeg::cos_deg ( const double  deg)
inlinestatic

static utility. calculate cosine value for degree angle

Parameters
degdegree value
Returns
cosine value

◆ cosMinMax()

void rcsc::AngleDeg::cosMinMax ( const double  angle_err,
double *  mincos,
double *  maxcos 
) const

calculate min/max cosine value of angle with angle error.

Parameters
angle_errerror value of angle
mincospointer to the solution variable to store the min value
maxcospointer to the solution variable to store the max value

◆ deg2rad()

static double rcsc::AngleDeg::deg2rad ( const double  deg)
inlinestatic

static utility. convert degree to radian

Parameters
degdegree value
Returns
radian value

◆ degree()

double rcsc::AngleDeg::degree ( ) const
inline

get value of this angle

Returns
const reference to the member variable

◆ isLeftEqualOf()

bool rcsc::AngleDeg::isLeftEqualOf ( const AngleDeg angle) const
inline

check if this angle is left or equal of 'angle'

Returns
true or false

◆ isLeftOf()

bool rcsc::AngleDeg::isLeftOf ( const AngleDeg angle) const
inline

check if this angle is left of 'angle'

Returns
true or false

◆ isRightEqualOf()

bool rcsc::AngleDeg::isRightEqualOf ( const AngleDeg angle) const
inline

check if this angle is right or equal of 'angle'

Returns
true or false

◆ isRightOf()

bool rcsc::AngleDeg::isRightOf ( const AngleDeg angle) const
inline

check if this angle is right of 'angle'

Returns
true or false

◆ isWithin()

bool rcsc::AngleDeg::isWithin ( const AngleDeg left,
const AngleDeg right 
) const

check if this angle is within [left, right] (turn clockwise).

Parameters
leftleft angle
rightright angle
Returns
true if this is within [left, right]. else false

◆ normalize_angle()

static double rcsc::AngleDeg::normalize_angle ( double  dir)
inlinestatic

static utility. normalize angle

Parameters
dirangle value to be normalized
Returns
normalized angle value

◆ operator*=()

const AngleDeg & rcsc::AngleDeg::operator*= ( const double  scalar)
inline

operator *=

Parameters
scalarmultiply argument
Returns
const reference to this

◆ operator+=() [1/2]

const AngleDeg & rcsc::AngleDeg::operator+= ( const AngleDeg angle)
inline

operator += with AngleDeg

Parameters
angleadded value
Returns
const reference to this

◆ operator+=() [2/2]

const AngleDeg & rcsc::AngleDeg::operator+= ( const double  deg)
inline

operator += with double

Parameters
degadded value
Returns
const reference to this

◆ operator-()

AngleDeg rcsc::AngleDeg::operator- ( ) const
inline

get new AngleDeg multiplyed by -1.

Returns
new AngleDeg object

◆ operator-=() [1/2]

const AngleDeg & rcsc::AngleDeg::operator-= ( const AngleDeg angle)
inline

operator -= with AngleDeg

Parameters
anglesubtract argument
Returns
const reference to this

◆ operator-=() [2/2]

const AngleDeg & rcsc::AngleDeg::operator-= ( const double  deg)
inline

operator -= with double

Parameters
degsubtract argument
Returns
const reference to this

◆ operator/=()

const AngleDeg & rcsc::AngleDeg::operator/= ( const double  scalar)
inline

operator /=

Parameters
scalardivision argument
Returns
const reference to this

◆ operator=()

const AngleDeg & rcsc::AngleDeg::operator= ( const double  deg)
inline

operator substitution.

Parameters
deginitialization parameter
Returns
const reference to itself

◆ print()

std::ostream & rcsc::AngleDeg::print ( std::ostream &  os) const
inline

output value to ostream

Parameters
osreference to the output stream
Returns
reference to the output stream

◆ printRound()

std::ostream & rcsc::AngleDeg::printRound ( std::ostream &  os,
const double  step = 0.1 
) const
inline

output rounded value to ostream

Parameters
osreference to the output stream
stepround step
Returns
reference to the output stream

◆ rad2deg()

static double rcsc::AngleDeg::rad2deg ( const double  rad)
inlinestatic

static utility. convert radian to degree

Parameters
radradian value
Returns
degree value

◆ radian()

double rcsc::AngleDeg::radian ( ) const
inline

get RADIAN value.

Returns
radian value of degree()

◆ sin()

double rcsc::AngleDeg::sin ( ) const
inline

calculate sine

Returns
sine value

◆ sin_deg()

static double rcsc::AngleDeg::sin_deg ( const double  deg)
inlinestatic

static utility. calculate sine value for degree angle

Parameters
degdegree value
Returns
sine value

◆ sinMinMax()

void rcsc::AngleDeg::sinMinMax ( const double  angle_err,
double *  minsin,
double *  maxsin 
) const

calculate min/max sine value with angle error.

Parameters
angle_errerror value of angle
minsinpointer to the solution variable to store the min value
maxsinpointer to the solution variable to store the max value

◆ tan()

double rcsc::AngleDeg::tan ( ) const
inline

calculate tarngetn

Returns
tangent value

◆ tan_deg()

static double rcsc::AngleDeg::tan_deg ( const double  deg)
inlinestatic

static utility. calculate tangent value for degree angle

Parameters
degdegree value
Returns
tangent value

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