mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[wpimath] Minor fixes to Rotation2d docs (NFC) (#4055)
Fixed incorrect examples on .plus(), and a missing word. Make example code snippets closer to actual use.
This commit is contained in:
@@ -70,7 +70,8 @@ public class Rotation2d implements Interpolatable<Rotation2d> {
|
||||
/**
|
||||
* Adds two rotations together, with the result being bounded between -pi and pi.
|
||||
*
|
||||
* <p>For example, Rotation2d.fromDegrees(30) + Rotation2d.fromDegrees(60) = Rotation2d{-pi/2}
|
||||
* <p>For example, <code>Rotation2d.fromDegrees(30).plus(Rotation2d.fromDegrees(60))</code> equals
|
||||
* <code>Rotation2d.fromRadians(Math.PI/2.0)</code>
|
||||
*
|
||||
* @param other The rotation to add.
|
||||
* @return The sum of the two rotations.
|
||||
@@ -82,7 +83,8 @@ public class Rotation2d implements Interpolatable<Rotation2d> {
|
||||
/**
|
||||
* Subtracts the new rotation from the current rotation and returns the new rotation.
|
||||
*
|
||||
* <p>For example, Rotation2d.fromDegrees(10) - Rotation2d.fromDegrees(100) = Rotation2d{-pi/2}
|
||||
* <p>For example, <code>Rotation2d.fromDegrees(10).minus(Rotation2d.fromDegrees(100))</code>
|
||||
* equals <code>Rotation2d.fromRadians(-Math.PI/2.0)</code>
|
||||
*
|
||||
* @param other The rotation to subtract.
|
||||
* @return The difference between the two rotations.
|
||||
|
||||
Reference in New Issue
Block a user