degree wrapper class
More...
#include <angle_deg.h>
|
| class | DegreeCmp |
| | predicate function object. this compares two angles by degree value More...
|
|
|
| AngleDeg () |
| | default constructor.
|
| | AngleDeg (const double °) |
| | constructor with value.
|
| const AngleDeg & | operator= (const double °) |
| | operator substitution.
|
| const double & | degree () const |
| | get value of this angle
|
| double | abs () const |
| | get absolute value of this angle
|
| double | radian () const |
| | get RADIAN value.
|
| AngleDeg | operator- () const |
| | get new AngleDeg multiplyed by -1.
|
| const AngleDeg & | operator+= (const AngleDeg &angle) |
| | operator += with AngleDeg
|
| const AngleDeg & | operator+= (const double °) |
| | operator += with double
|
| const AngleDeg & | operator-= (const AngleDeg &angle) |
| | operator -= with AngleDeg
|
| const AngleDeg & | operator-= (const double °) |
| | operator -= with double
|
| const AngleDeg & | operator*= (const double &scalar) |
| | operator *=
|
| const AngleDeg & | operator/= (const double &scalar) |
| | operator /=
|
| bool | isLeftOf (const AngleDeg &angle) const |
| | check if this angle is left of 'angle'
|
| bool | isLeftEqualOf (const AngleDeg &angle) const |
| | check if this angle is left or equal of 'angle'
|
| bool | isRightOf (const AngleDeg &angle) const |
| | check if this angle is right of 'angle'
|
| bool | isRightEqualOf (const AngleDeg &angle) const |
| | check if this angle is right or equal of 'angle'
|
| double | cos () const |
| | calculate cosine
|
| double | sin () const |
| | calculate sine
|
| double | tan () const |
| | calculate tarngetn
|
| bool | isWithin (const AngleDeg &left, const AngleDeg &right) const |
| | check if this angle is within [left, right] (turn clockwise).
|
| void | sinMinMax (const double &angle_err, double *minsin, double *maxsin) const |
| | calculate min/max sine value with angle error.
|
| void | cosMinMax (const double &angle_err, double *mincos, double *maxcos) const |
| | calculate min/max cosine value of angle with angle error.
|
| std::ostream & | print (std::ostream &os) const |
| | output value to ostream
|
| std::ostream & | printRound (std::ostream &os, const double &step=0.1) const |
| | output rounded value to ostream
|
|
| static double | normalize_angle (double dir) |
| | static utility. normalize angle
|
| static double | rad2deg (const double &rad) |
| | static utility. convert radian to degree
|
| static double | deg2rad (const double °) |
| | static utility. convert degree to radian
|
| static double | cos_deg (const double °) |
| | static utility. calculate cosine value for degree angle
|
| static double | sin_deg (const double °) |
| | static utility. calculate sine value for degree angle
|
| static double | tan_deg (const double °) |
| | static utility. calculate tangent value for degree angle
|
| static double | acos_deg (const double &cosine) |
| | static utility. calculate arc cosine value
|
| static double | asin_deg (const double &sine) |
| | static utility. calculate arc sine value
|
| static double | atan_deg (const double &tangent) |
| | static utility. calculate arc tangent value
|
| static double | atan2_deg (const double &y, const double &x) |
| | static utility. calculate arc tangent value from XY
|
| static AngleDeg | bisect (const AngleDeg &left, const AngleDeg &right) |
| | static utility that returns bisect angle of [left, right].
|
|
|
static const double | EPSILON = 1.0e-5 |
| | epsilon value
|
|
static const double | PI = M_PI |
| | pi valur
|
|
static const double | TWO_PI = M_PI * 2.0 |
| | 2*pi valur
|
|
static const double | DEG2RAD = M_PI / 180.0 |
| | constant variable to convert DEGREE to RADIAN.
|
|
static const double | RAD2DEG = 180.0 / M_PI |
| | constant variable to convert RADIAN to DEGREE.
|
◆ 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;
◆ abs()
| double rcsc::AngleDeg::abs |
( |
| ) |
const |
|
inline |
get absolute value of this angle
- Returns
- absolute value of degree()
◆ acos_deg()
| double rcsc::AngleDeg::acos_deg |
( |
const double & | cosine | ) |
|
|
inlinestatic |
static utility. calculate arc cosine value
- Parameters
-
- Returns
- arc cosine value, that is degree type.
◆ asin_deg()
| double rcsc::AngleDeg::asin_deg |
( |
const double & | sine | ) |
|
|
inlinestatic |
static utility. calculate arc sine value
- Parameters
-
- Returns
- arc sine value, that is degree type.
◆ atan2_deg()
| double rcsc::AngleDeg::atan2_deg |
( |
const double & | y, |
|
|
const double & | x ) |
|
inlinestatic |
static utility. calculate arc tangent value from XY
- Parameters
-
| y | coordinate Y |
| x | coordinate X |
- Returns
- arc tangent value, that is degree type.
◆ atan_deg()
| double rcsc::AngleDeg::atan_deg |
( |
const double & | tangent | ) |
|
|
inlinestatic |
static utility. calculate arc tangent value
- Parameters
-
- Returns
- arc tangent value, that is degree.
◆ bisect()
static utility that returns bisect angle of [left, right].
- Parameters
-
| left | left start angle |
| right | right 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()
| double rcsc::AngleDeg::cos_deg |
( |
const double & | deg | ) |
|
|
inlinestatic |
static utility. calculate cosine value for degree angle
- Parameters
-
- 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_err | error value of angle |
| mincos | pointer to the solution variable to store the min value |
| maxcos | pointer to the solution variable to store the max value |
◆ deg2rad()
| double rcsc::AngleDeg::deg2rad |
( |
const double & | deg | ) |
|
|
inlinestatic |
static utility. convert degree to radian
- Parameters
-
- Returns
- radian value
◆ degree()
| const 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
-
| left | left angle |
| right | right angle |
- Returns
- true if this is within [left, right]. else false
◆ normalize_angle()
| double rcsc::AngleDeg::normalize_angle |
( |
double | dir | ) |
|
|
inlinestatic |
static utility. normalize angle
- Parameters
-
| dir | angle value to be normalized |
- Returns
- normalized angle value
◆ operator*=()
| const AngleDeg & rcsc::AngleDeg::operator*= |
( |
const double & | scalar | ) |
|
|
inline |
operator *=
- Parameters
-
- Returns
- const reference to this
◆ operator+=() [1/2]
operator += with AngleDeg
- Parameters
-
- Returns
- const reference to this
◆ operator+=() [2/2]
| const AngleDeg & rcsc::AngleDeg::operator+= |
( |
const double & | deg | ) |
|
|
inline |
operator += with double
- Parameters
-
- Returns
- const reference to this
◆ operator-()
| AngleDeg rcsc::AngleDeg::operator- |
( |
| ) |
const |
|
inline |
◆ operator-=() [1/2]
operator -= with AngleDeg
- Parameters
-
- Returns
- const reference to this
◆ operator-=() [2/2]
| const AngleDeg & rcsc::AngleDeg::operator-= |
( |
const double & | deg | ) |
|
|
inline |
operator -= with double
- Parameters
-
- Returns
- const reference to this
◆ operator/=()
| const AngleDeg & rcsc::AngleDeg::operator/= |
( |
const double & | scalar | ) |
|
|
inline |
operator /=
- Parameters
-
- Returns
- const reference to this
◆ operator=()
| const AngleDeg & rcsc::AngleDeg::operator= |
( |
const double & | deg | ) |
|
|
inline |
operator substitution.
- Parameters
-
| deg | initialization parameter |
- Returns
- const reference to itself
◆ print()
| std::ostream & rcsc::AngleDeg::print |
( |
std::ostream & | os | ) |
const |
|
inline |
output value to ostream
- Parameters
-
| os | reference 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
-
| os | reference to the output stream |
| step | round step |
- Returns
- reference to the output stream
◆ rad2deg()
| double rcsc::AngleDeg::rad2deg |
( |
const double & | rad | ) |
|
|
inlinestatic |
static utility. convert radian to degree
- Parameters
-
- 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()
| double rcsc::AngleDeg::sin_deg |
( |
const double & | deg | ) |
|
|
inlinestatic |
static utility. calculate sine value for degree angle
- Parameters
-
- 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_err | error value of angle |
| minsin | pointer to the solution variable to store the min value |
| maxsin | pointer to the solution variable to store the max value |
◆ tan()
| double rcsc::AngleDeg::tan |
( |
| ) |
const |
|
inline |
calculate tarngetn
- Returns
- tangent value
◆ tan_deg()
| double rcsc::AngleDeg::tan_deg |
( |
const double & | deg | ) |
|
|
inlinestatic |
static utility. calculate tangent value for degree angle
- Parameters
-
- Returns
- tangent value
The documentation for this class was generated from the following files: