From e42a0b6cf04d1d399d94749088ab257ce039c29a Mon Sep 17 00:00:00 2001 From: Zachary Orr <516458+ZachOrr@users.noreply.github.com> Date: Tue, 16 Feb 2021 21:06:01 -0500 Subject: [PATCH] [wpimath] Rotation2d comment formatting (NFC) (#3162) --- .../java/edu/wpi/first/wpilibj/geometry/Rotation2d.java | 9 +++++++-- .../src/main/native/include/frc/geometry/Rotation2d.h | 5 +++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/wpimath/src/main/java/edu/wpi/first/wpilibj/geometry/Rotation2d.java b/wpimath/src/main/java/edu/wpi/first/wpilibj/geometry/Rotation2d.java index c408de859c..c4c83a811c 100644 --- a/wpimath/src/main/java/edu/wpi/first/wpilibj/geometry/Rotation2d.java +++ b/wpimath/src/main/java/edu/wpi/first/wpilibj/geometry/Rotation2d.java @@ -112,8 +112,13 @@ public class Rotation2d { /** * Adds the new rotation to the current rotation using a rotation matrix. * - *
The matrix multiplication is as follows: [cos_new] [other.cos, -other.sin][cos] [sin_new] = - * [other.sin, other.cos][sin] value_new = atan2(cos_new, sin_new) + *
The matrix multiplication is as follows: + * + *
+ * [cos_new] [other.cos, -other.sin][cos] + * [sin_new] = [other.sin, other.cos][sin] + * value_new = atan2(sin_new, cos_new) + ** * @param other The rotation to rotate by. * @return The new rotated Rotation2d. diff --git a/wpimath/src/main/native/include/frc/geometry/Rotation2d.h b/wpimath/src/main/native/include/frc/geometry/Rotation2d.h index 4a69124b21..1748e60d9a 100644 --- a/wpimath/src/main/native/include/frc/geometry/Rotation2d.h +++ b/wpimath/src/main/native/include/frc/geometry/Rotation2d.h @@ -131,10 +131,11 @@ class Rotation2d { /** * Adds the new rotation to the current rotation using a rotation matrix. * + *
* [cos_new] [other.cos, -other.sin][cos]
* [sin_new] = [other.sin, other.cos][sin]
- *
- * value_new = std::atan2(cos_new, sin_new)
+ * value_new = std::atan2(sin_new, cos_new)
+ *
*
* @param other The rotation to rotate by.
*