[wpimath] Implement Translation3d.RotateAround (#7661)

This commit is contained in:
HarryXChen
2025-01-09 23:31:34 -05:00
committed by GitHub
parent 995bc98ccf
commit e37c35746a
5 changed files with 94 additions and 1 deletions

View File

@@ -216,6 +216,17 @@ public class Translation3d
return new Translation3d(qprime.getX(), qprime.getY(), qprime.getZ());
}
/**
* Rotates this translation around another translation in 3D space.
*
* @param other The other translation to rotate around.
* @param rot The rotation to rotate the translation by.
* @return The new rotated translation.
*/
public Translation3d rotateAround(Translation3d other, Rotation3d rot) {
return this.minus(other).rotateBy(rot).plus(other);
}
/**
* Returns a Translation2d representing this Translation3d projected into the X-Y plane.
*