Class representing a rotation in 2d space. Stores cos and sin, and computes angles based on that.
By nature the stored angle is wrapped, but there are functions that return angles wrapped specifically between e.g. [-180, 180) and [0, 360)
If you need your angle to be continuous use units::Angle instead.
|
|
constexpr | Rotation2d ()=default |
| | Default Constructor for Rotation2d.
|
|
constexpr | Rotation2d (units::Angle value) |
| | Constructs a rotation given a units::Angle.
|
|
constexpr | Rotation2d (double value) |
| | Constructs a rotation given an angle in radians.
|
| constexpr | Rotation2d (double x, double y) |
| constexpr | Rotation2d (units::Length x, units::Length y) |
|
constexpr units::Angle | angle () const |
| | Gets an Angle equal to this rotation.
|
|
constexpr double | angle (units::Angle unit) const |
| | Gets the angle in the supplied unit.
|
|
constexpr double | radians () const |
| | Gets the rotation in radians.
|
|
constexpr double | degrees () const |
| | Gets the rotation in degrees.
|
|
constexpr double | revolutions () const |
| | Gets the rotation in revolutions.
|
|
constexpr double | gradians () const |
| | Gets the rotation in gradians.
|
|
constexpr double | f_cos () const |
| | Gets the cosine of the rotation.
|
|
constexpr double | f_sin () const |
| | Gets the sine of the rotation.
|
|
constexpr double | f_tan () const |
| | Gets the tangent of the rotation.
|
|
constexpr Rotation2d | inverse () const |
| | Inverts this rotation (conjugate).
|
|
constexpr Rotation2d | opposite () const |
| | Flips this rotation across the origin.
|
|
constexpr EMat< 2, 2 > | rotation_matrix () const |
| | Gets the rotation matrix corresponding to this rotation.
|
|
constexpr double | wrapped_radians_180 () const |
| | Gets the value of this rotation in radians from [-pi, pi].
|
|
constexpr double | wrapped_degrees_180 () const |
| | Gets the value of this rotation in degrees from [-180, 180].
|
|
constexpr double | wrapped_revolutions_180 () const |
| | Gets the value of this rotation in revolutions from [-0.5, 0.5].
|
|
constexpr double | wrapped_gradians_180 () const |
| | Gets the value of this rotation in gradians from [-200, 200].
|
|
constexpr double | wrapped_radians_360 () const |
| | Gets the value of this rotation in radians from [0, 2pi).
|
|
constexpr double | wrapped_degrees_360 () const |
| | Gets the value of this rotation in degrees from [0, 360).
|
|
constexpr double | wrapped_revolutions_360 () const |
| | Gets the value of this rotation in revolutions from [0, 1).
|
|
constexpr double | wrapped_gradians_360 () const |
| | Gets the value of this rotation in gradians from [0, 400).
|
|
constexpr Rotation2d | operator+ (Rotation2d other) const |
| | Adds another rotation to this rotation.
|
|
constexpr Rotation2d & | operator+= (Rotation2d other) |
| | Adds another rotation to this rotation.
|
|
constexpr Rotation2d | operator- (Rotation2d other) const |
| | Subtracts another rotation from this rotation.
|
|
constexpr Rotation2d & | operator-= (Rotation2d other) |
| | Subtracts another rotation from this rotation.
|
|
constexpr Rotation2d | operator- () const |
| | Inverts this rotation (conjugate).
|
|
constexpr Rotation2d | operator* (double scalar) const |
| | Multiplies this rotation by a scalar.
|
|
constexpr Rotation2d & | operator*= (double scalar) |
| | Multiplies this rotation by a scalar.
|
|
constexpr Rotation2d | operator/ (double scalar) const |
| | Divides this rotation by a scalar.
|
|
constexpr Rotation2d & | operator/= (double scalar) |
| | Divides this rotation by a scalar.
|
|
constexpr bool | operator== (Rotation2d other) const |
| | Checks exact equality between this rotation and another rotation.
|
|
constexpr bool | is_near (Rotation2d other, units::Angle tolerance=units::Angle(1e-6)) const |
| | Compares two angles with a default tolerance of 1e-6 radians.
|