|
KanoopCommonQt 2.1.1
Kanoop foundational Qt utility library
|
|
A compass bearing angle measured in degrees, with wraparound arithmetic. More...
#include <angle.h>
Public Member Functions | |
| Angle () | |
| Default constructor — creates an invalid angle with value -1. | |
| Angle (double degrees) | |
| Construct an Angle with the given degree value. | |
| Angle | operator+ (const Angle &other) const |
| Add another Angle, wrapping around 360 degrees. | |
| Angle | operator+ (double degrees) const |
| Add a scalar degree value, wrapping around 360 degrees. | |
| Angle | operator- (const Angle &other) const |
| Subtract another Angle, wrapping around 360 degrees. | |
| Angle | operator- (double degrees) const |
| Subtract a scalar degree value, wrapping around 360 degrees. | |
| void | operator+= (const Angle &other) |
| Add another Angle in place. | |
| void | operator+= (double degrees) |
| Add a scalar degree value in place. | |
| void | operator-= (const Angle &other) |
| Subtract another Angle in place. | |
| void | operator-= (double degrees) |
| Subtract a scalar degree value in place. | |
| double | degrees () const |
| Return the angle in degrees. | |
| void | setDegrees (double value) |
| Set the angle in degrees. | |
| void | add (double degrees) |
| Add a degree amount with wraparound in place. | |
| void | subtract (double degrees) |
| Subtract a degree amount with wraparound in place. | |
| QString | toString () const |
| Format the angle as a string. | |
A compass bearing angle measured in degrees, with wraparound arithmetic.
Represents an angle in degrees with wraparound-aware addition and subtraction.
Angles are stored in degrees. Arithmetic operators automatically keep values in the range [0, 360).
|
inline |
|
inline |
| void Angle::add | ( | double | degrees | ) |
Add a degree amount with wraparound in place.
| degrees | Degrees to add |
|
inline |
| Angle Angle::operator+ | ( | double | degrees | ) | const |
Add a scalar degree value, wrapping around 360 degrees.
| degrees | Degrees to add |
|
inline |
|
inline |
| Angle Angle::operator- | ( | double | degrees | ) | const |
Subtract a scalar degree value, wrapping around 360 degrees.
| degrees | Degrees to subtract |
|
inline |
|
inline |
|
inline |
| void Angle::subtract | ( | double | degrees | ) |
Subtract a degree amount with wraparound in place.
| degrees | Degrees to subtract |
|
inline |