mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[wpimath] Implement Translation3d.RotateAround (#7661)
This commit is contained in:
@@ -148,6 +148,18 @@ class WPILIB_DLLEXPORT Translation3d {
|
||||
units::meter_t{qprime.Z()}};
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
constexpr Translation3d RotateAround(const Translation3d& other,
|
||||
const Rotation3d& rot) const {
|
||||
return (*this - other).RotateBy(rot) + other;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a Translation2d representing this Translation3d projected into the
|
||||
* X-Y plane.
|
||||
|
||||
Reference in New Issue
Block a user