
#include <Util/Angle.H>
This class provides functions to manipulate and do maths on angles. The internal representation is a double value in degrees in the range ]-180.0 .. 180.0]. This is an all-inlined class, so there is no Angle.C file.
Definition at line 49 of file Angle.H.
Public Member Functions | |
Constructors, destructor, assigments, and conversions | |
| Angle (const double val=0.0) | |
| Constructor. Initial value should be in degrees. | |
| Angle (const Angle &ang) | |
| Copy constructor. | |
| ~Angle () | |
| Destructor. | |
| Angle & | operator= (const Angle &ang) |
| Assignment. | |
| Angle & | operator= (const double ang) |
| Assignment. | |
| void | setVal (const double val) |
| Set a new value in degrees. | |
| double | getVal () const |
| Get current value in degrees in ]-180.0 .. 180.0]. | |
| void | setRadians (const double val) |
| Conversion from radians. | |
| double | getRadians () const |
| Get value in radians (in [-pi .. pi]). | |
Arithmetic operators | |
| Angle & | operator+= (const Angle &other) |
| Addition. Result is taken modulo 360 and remains in ]-180.0 .. 180.0]. | |
| Angle & | operator-= (const Angle &other) |
| Subtraction. Result is taken modulo 360 and remains in ]-180.0 .. 180.0]. | |
| Angle & | operator *= (const double fac) |
| Multiplication by a constant. Result remains in ]-180.0 .. 180.0]. | |
| Angle & | operator/= (const double fac) |
| Division by a constant. Result remains in ]-180.0 .. 180.0]. | |
| Angle | operator+ (const Angle &other) const |
| Addition of two angles. Result remains in ]-180.0 .. 180.0]. | |
| Angle | operator- (const Angle &other) const |
| Subtraction of two angles. Result remains in ]-180.0 .. 180.0]. | |
| void | vectorAdd (const Angle &other, const double otherlen=1.0) |
| Combine with another angle, in vector style. | |
| bool | operator< (const Angle &other) const |
| Comparison. USE WITH CAUTION! | |
| bool | operator> (const Angle &other) const |
| Comparison. USE WITH CAUTION! | |
| bool | operator!= (const Angle &other) const |
| Comparison. USE WITH CAUTION! | |
| bool | operator< (const double other) const |
| Comparison. USE WITH CAUTION! | |
| bool | operator> (const double other) const |
| Comparison. USE WITH CAUTION! | |
| bool | operator!= (const double other) const |
| Comparison. USE WITH CAUTION! | |
|
|
Constructor. Initial value should be in degrees.
|
|
|
Copy constructor.
|
|
|
Destructor.
|
|
|
Get value in radians (in [-pi .. pi]).
Definition at line 201 of file Angle.H. Referenced by SeaBee::advanceRel(), BeoSubOneBal::advanceRel(), orientMe(), and tiltMe(). |
|
|
Get current value in degrees in ]-180.0 .. 180.0].
Definition at line 193 of file Angle.H. Referenced by BeoSub::ApproachPipeLine(), SupplementaryMotorAreaI::evolve(), BeoSub::LookForRedLight(), main(), BeoSubQtMainForm::matchAndDirect(), IMUListener::newData(), TestBeoSubIMUListener::newData(), TestHMR3300Listener::newData(), packageSensorResult(), BeoSub::pitchAbs(), BeoSubOneBal::setRotVel(), BeoSub::targetReached(), PreMotorComplex::turn(), BeoSub::turnAbs(), BeoSubOneBal::turnOpen(), and BeoSubOneBal::updateCompass(). |
|
|
Multiplication by a constant. Result remains in ]-180.0 .. 180.0].
|
|
|
Comparison. USE WITH CAUTION!
|
|
|
Comparison. USE WITH CAUTION!
Definition at line 250 of file Angle.H. References angle. |
|
|
Addition of two angles. Result remains in ]-180.0 .. 180.0].
Definition at line 221 of file Angle.H. References fixValue(). |
|
|
Addition. Result is taken modulo 360 and remains in ]-180.0 .. 180.0].
Definition at line 205 of file Angle.H. References angle. |
|
|
Subtraction of two angles. Result remains in ]-180.0 .. 180.0].
Definition at line 225 of file Angle.H. References fixValue(). |
|
|
Subtraction. Result is taken modulo 360 and remains in ]-180.0 .. 180.0].
Definition at line 209 of file Angle.H. References angle. |
|
|
Division by a constant. Result remains in ]-180.0 .. 180.0].
|
|
|
Comparison. USE WITH CAUTION!
|
|
|
Comparison. USE WITH CAUTION!
Definition at line 242 of file Angle.H. References angle. |
|
|
Assignment.
|
|
|
Assignment.
Definition at line 181 of file Angle.H. References angle. |
|
|
Comparison. USE WITH CAUTION!
|
|
|
Comparison. USE WITH CAUTION!
Definition at line 246 of file Angle.H. References angle. |
|
|
Conversion from radians.
|
|
|
Set a new value in degrees.
Definition at line 189 of file Angle.H. Referenced by BeoSubDB::initializeDatabase(). |
|
||||||||||||
|
Combine with another angle, in vector style. This computes the sum of a unit vector with our angle and a vector with other's angle and optionally a given length. The result is the angle of the combined vector. Special cases (e.g., other is the exact opposite of us) are handled like atan2() would. Definition at line 229 of file Angle.H. References angle, lobot::cos(), lobot::sin(), x, and y. |
1.4.4