|
ThunderLib
|
#include <CanonicalAngle.hpp>
Public Member Functions | |
| CanonicalAngle ()=default | |
| CanonicalAngle (const frc::Rotation2d &rotation) | |
| CanonicalAngle (units::angle_unit auto value) | |
| CanonicalAngle (double x, double y) | |
| double | cos () const |
| double | sin () const |
| double | tan () const |
| units::radian_t | radians () const |
| units::degree_t | degrees () const |
| operator frc::Rotation2d () const | |
| operator units::angle_unit auto () const | |
| bool | operator== (const CanonicalAngle &other) const |
| bool | operator!= (const CanonicalAngle &other) const |
| CanonicalAngle | operator- () const |
| CanonicalAngle | operator+ (const CanonicalAngle &other) const |
| CanonicalAngle | operator- (const CanonicalAngle &other) const |
| CanonicalAngle | operator* (double scalar) const |
| CanonicalAngle | operator/ (double scalar) const |
| CanonicalAngle | rotateBy (const CanonicalAngle &other) const |
| CanonicalAngle | supplementary () const |
| bool | isSupplementaryTo (const CanonicalAngle &other) const |
Represents an angle in the range of (-π, π]. This class is similar to frc::Rotation2d, but is designed to represent angles in a more mathematically consistent way, avoiding issues with wrapping and discontinuities.
|
default |
Constructs a CanonicalAngle with a default value of 0 radians.
|
inline |
Constructs a CanonicalAngle from a Rotation2d.
| rotation | The Rotation2d to convert to a CanonicalAngle. |
|
inline |
Constructs a CanonicalAngle with the specified angle value.
| value | The angle value. |
|
inline |
Constructs a CanonicalAngle with the specified x and y components.
| x | The x component or cosine of the angle. |
| y | The y component or sine of the angle. |
|
inline |
Checks if this angle is supplementary to another angle.
| other | The angle to check against. |
|
inline |
Takes the inverse (negation) of the current angle.
|
inline |
Rotates the current angle by another angle.
| other | The angle to rotate by. |
|
inline |
Calculates the supplementary angle.