![]() |
RaidZeroLib
Coroutine robot framework for VEX V5
|
Immutable planar rotation about the Z axis. More...
#include <Rotation.hpp>
Public Member Functions | |
| constexpr | Rotation () noexcept=default |
| Constructs a zero rotation. | |
| Rotation (Angle theta) noexcept | |
| Constructs from an angle. | |
| Rotation (Length x, Length y) noexcept | |
| Constructs from a Cartesian vector (x, y). | |
| Rotation (double x, double y) noexcept | |
| Constructs from a Cartesian vector (x, y). | |
| Angle | Theta () const noexcept |
| Returns the normalized angle in radians. | |
| double | Sin () const noexcept |
| Sine of the rotation. | |
| double | Cos () const noexcept |
| Cosine of the rotation. | |
| double | Tan () const noexcept |
| Tangent of the rotation. | |
| Rotation | operator+ (const Rotation &rhs) const noexcept |
| Angle addition. | |
| Rotation | operator- (const Rotation &rhs) const noexcept |
| Angle subtraction. | |
| Rotation & | operator+= (const Rotation &rhs) noexcept |
| Adds rhs to this rotation, normalized. | |
| Rotation & | operator-= (const Rotation &rhs) noexcept |
| Subtracts rhs from this rotation, normalized. | |
| Rotation | operator- () const noexcept |
| Unary negation. | |
| Rotation | operator* (double scalar) const noexcept |
| Multiplies the angle by a scalar. | |
| Rotation | operator/ (double scalar) const noexcept |
| Divides the angle by a scalar. | |
| bool | isApprox (const Rotation &rhs) const noexcept |
| Approximate equality check with angular tolerance. | |
Immutable planar rotation about the Z axis.
Rotation represents an angle in radians (right-handed, counter-clockwise positive) and provides trigonometric accessors, arithmetic, and comparison helpers.
All angles are internally normalized to (-180, 180] degrees so that equivalent rotations share a canonical representation. This guarantees stable arithmetic and comparisons across operations.
|
constexprdefaultnoexcept |
Constructs a zero rotation.
Equivalent to Rotation(au::ZERO); the internal angle is 0 rad.
|
explicitnoexcept |
Constructs from an angle.
| theta | the angle. |
Constructs from a Cartesian vector (x, y).
Computes atan2(y, x) to obtain the heading of the vector. If both x and y are zero, the resulting rotation is defined as zero.
| x | X component (length units). |
| y | Y component (length units). |
|
noexcept |
Constructs from a Cartesian vector (x, y).
Computes atan2(y, x) to obtain the heading of the vector. If both x and y are zero, the resulting rotation is defined as zero.
| x | X component (unitless). |
| y | Y component (unitless). |
|
noexcept |
Cosine of the rotation.
|
noexcept |
Approximate equality check with angular tolerance.
Computes the normalized minimum signed difference between the two rotations and compares its absolute value to 1e-9 radians.
| rhs | Rotation to compare with. |
|
noexcept |
Multiplies the angle by a scalar.
| scalar | Multiplication applied to the angle. |
Adds rhs to this rotation, normalized.
|
noexcept |
Unary negation.
Subtracts rhs from this rotation, normalized.
|
noexcept |
Divides the angle by a scalar.
Equivalent to multiplying by 1.0 / scalar.
| scalar | Divisor applied to the angle. |
|
noexcept |
Sine of the rotation.
|
noexcept |
Tangent of the rotation.
|
noexcept |
Returns the normalized angle in radians.