From 0a3ff04cfb41b7a78746d556eb793092b61f182f Mon Sep 17 00:00:00 2001 From: Isaac Turner Date: Sun, 31 Mar 2024 15:15:18 +0800 Subject: [PATCH 1/2] [wpimath] add Measure getter for Rotation2d --- .../java/edu/wpi/first/math/geometry/Rotation2d.java | 9 +++++++++ 1 file changed, 9 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 1106a103a52..e4f4cb0176c 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 @@ -187,6 +187,15 @@ public Rotation2d rotateBy(Rotation2d other) { m_cos * other.m_cos - m_sin * other.m_sin, m_cos * other.m_sin + m_sin * other.m_cos); } + /** + * Returns the measure of the Rotation2d. + * + * @return The measure of the Rotation2d. + */ + public Measure getMeasure() { + return Radians.of(getRadians()); + } + /** * Returns the radian value of the Rotation2d. * From 54bf7327fe45bb0f1eb6cb044ebd5dbef28b7091 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 31 Mar 2024 07:26:51 +0000 Subject: [PATCH 2/2] Formatting fixes --- .../main/java/edu/wpi/first/math/geometry/Rotation2d.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 e4f4cb0176c..435ceed7ab2 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 @@ -192,9 +192,9 @@ public Rotation2d rotateBy(Rotation2d other) { * * @return The measure of the Rotation2d. */ - public Measure getMeasure() { - return Radians.of(getRadians()); - } + public Measure getMeasure() { + return Radians.of(getRadians()); + } /** * Returns the radian value of the Rotation2d.