RaidZeroLib
Coroutine robot framework for VEX V5
Loading...
Searching...
No Matches
Rotation.hpp
1#pragma once
2#include "RaidZeroLib/api/Units/Units.hpp"
3
4namespace rz {
5
16class Rotation {
17 public:
23 constexpr Rotation() noexcept = default;
24
30 explicit Rotation(Angle theta) noexcept;
31
41 Rotation(Length x, Length y) noexcept;
42
52 Rotation(double x, double y) noexcept;
53
59 Angle Theta() const noexcept;
60
66 double Sin() const noexcept;
67
73 double Cos() const noexcept;
74
80 double Tan() const noexcept;
81
88 Rotation operator+(const Rotation& rhs) const noexcept;
89
96 Rotation operator-(const Rotation& rhs) const noexcept;
97
101 Rotation& operator+=(const Rotation& rhs) noexcept;
102
106 Rotation& operator-=(const Rotation& rhs) noexcept;
107
113 Rotation operator-() const noexcept;
114
121 Rotation operator*(double scalar) const noexcept;
122
131 Rotation operator/(double scalar) const noexcept;
132
142 bool isApprox(const Rotation& rhs) const noexcept;
143
144 private:
145 Angle theta = au::ZERO;
146};
147
148} // namespace rz
Angle Theta() const noexcept
Returns the normalized angle in radians.
bool isApprox(const Rotation &rhs) const noexcept
Approximate equality check with angular tolerance.
constexpr Rotation() noexcept=default
Constructs a zero rotation.
double Tan() const noexcept
Tangent of the rotation.
double Sin() const noexcept
Sine of the rotation.
double Cos() const noexcept
Cosine of the rotation.
au::QuantityD< au::Radians > Angle
Definition Units.hpp:13
au::QuantityD< au::Meters > Length
Definition Units.hpp:9
Definition DriverControl.hpp:11