|
Thunderbots Project
|
#include <angle.h>
Public Member Functions | |
| constexpr | Angle () |
| constexpr double | toRadians () const |
| constexpr double | toDegrees () const |
| constexpr Angle | mod (Angle divisor) const |
| constexpr Angle | remainder (const Angle &divisor) const |
| constexpr Angle | abs () const |
| bool | isFinite () const |
| double | sin () const |
| double | cos () const |
| double | tan () const |
| constexpr Angle | clamp () const |
| constexpr Angle | minDiff (const Angle &other) const |
Static Public Member Functions | |
| static constexpr Angle | zero () |
| static constexpr Angle | quarter () |
| static constexpr Angle | half () |
| static constexpr Angle | threeQuarter () |
| static constexpr Angle | full () |
| static constexpr Angle | fromRadians (double rad) |
| static constexpr Angle | fromDegrees (double deg) |
| static Angle | asin (double x) |
| static Angle | acos (double x) |
| static Angle | atan (double x) |
A typesafe representation of an angle.
This class helps prevent accidentally combining values in degrees and radians without proper conversion.
|
inlineexplicitconstexpr |
Constructs the "zero" angle.
|
inlineconstexpr |
Returns the absolute value of this angle.
|
inlinestatic |
Computes the arccosine of a value.
| x | the value. |
|
inlinestatic |
Computes the arcsine of a value.
| x | the value. |
|
inlinestatic |
Computes the arctangent of a value.
| x | the value. |
|
inlineconstexpr |
Limits this angle to [−π, π].
The angle is rotated by a multiple of 2π until it lies within the target interval.
|
inline |
Computes the cosine of this angle.
|
inlinestaticconstexpr |
Constructs an angle from a value in degrees.
| deg | the angle in degrees |
|
inlinestaticconstexpr |
Constructs an angle from a value in radians.
| rad | the angle in radians. |
|
inlinestaticconstexpr |
The full-turn angle (360°).
|
inlinestaticconstexpr |
The half-turn angle (180°).
|
inline |
Checks whether the angle is finite.
Returns the smallest possible rotational difference between this angle and another angle.
| other | the second angle. |
Computes the modulus of a division between this angle and another angle.
| divisor | the divisor. |
|
inlinestaticconstexpr |
The quarter-turn angle (90°).
Computes the remainder of a division between this angle and another angle.
| divisor | the divisor. |
|
inline |
Computes the sine of this angle.
|
inline |
Computes the tangent of this angle.
|
inlinestaticconstexpr |
The three-quarter turn angle (270°).
|
inlineconstexpr |
Converts this angle to a value in degrees.
|
inlineconstexpr |
Converts this angle to a value in radians.
|
inlinestaticconstexpr |
The zero angle.