From 4a0ad6b48c604cba7873d91f1966c935a572e153 Mon Sep 17 00:00:00 2001 From: ohowe Date: Sat, 10 Dec 2022 00:35:15 -0700 Subject: [PATCH] [wpimath] Rotation2d: Add reference to angleModulus in docs (NFC) (#4786) --- .../src/main/java/edu/wpi/first/math/geometry/Rotation2d.java | 3 +++ wpimath/src/main/native/include/frc/geometry/Rotation2d.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/wpimath/src/main/java/edu/wpi/first/math/geometry/Rotation2d.java b/wpimath/src/main/java/edu/wpi/first/math/geometry/Rotation2d.java index 6caefa5d7b..5be61561e4 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/geometry/Rotation2d.java +++ b/wpimath/src/main/java/edu/wpi/first/math/geometry/Rotation2d.java @@ -173,6 +173,7 @@ public class Rotation2d implements Interpolatable { * Returns the radian value of the Rotation2d. * * @return The radian value of the Rotation2d. + * @see edu.wpi.first.math.MathUtil#angleModulus(double) to constrain the angle within (-pi, pi] */ @JsonProperty public double getRadians() { @@ -183,6 +184,8 @@ public class Rotation2d implements Interpolatable { * Returns the degree value of the Rotation2d. * * @return The degree value of the Rotation2d. + * @see edu.wpi.first.math.MathUtil#inputModulus(double, double, double) to constrain the angle + * within (-180, 180] */ public double getDegrees() { return Math.toDegrees(m_value); diff --git a/wpimath/src/main/native/include/frc/geometry/Rotation2d.h b/wpimath/src/main/native/include/frc/geometry/Rotation2d.h index e40f3facaf..406ef3c15c 100644 --- a/wpimath/src/main/native/include/frc/geometry/Rotation2d.h +++ b/wpimath/src/main/native/include/frc/geometry/Rotation2d.h @@ -132,6 +132,7 @@ class WPILIB_DLLEXPORT Rotation2d { * Returns the radian value of the rotation. * * @return The radian value of the rotation. + * @see AngleModulus to constrain the angle within (-pi, pi] */ constexpr units::radian_t Radians() const { return m_value; } @@ -139,6 +140,7 @@ class WPILIB_DLLEXPORT Rotation2d { * Returns the degree value of the rotation. * * @return The degree value of the rotation. + * @see InputModulus to constrain the angle within (-180, 180] */ constexpr units::degree_t Degrees() const { return m_value; }