[wpimath] Add scalar multiply and divide operators to all geometry classes (#4438)

Closes #4435.
This commit is contained in:
Tyler Veness
2022-09-28 21:34:29 -07:00
committed by GitHub
parent 3937ff8221
commit 38bb23eb18
16 changed files with 180 additions and 4 deletions

View File

@@ -81,7 +81,7 @@ class WPILIB_DLLEXPORT Transform3d {
Transform3d Inverse() const;
/**
* Scales the transform by the scalar.
* Multiplies the transform by the scalar.
*
* @param scalar The scalar.
* @return The scaled Transform3d.
@@ -90,6 +90,14 @@ class WPILIB_DLLEXPORT Transform3d {
return Transform3d(m_translation * scalar, m_rotation * scalar);
}
/**
* Divides the transform by the scalar.
*
* @param scalar The scalar.
* @return The scaled Transform3d.
*/
Transform3d operator/(double scalar) const { return *this * (1.0 / scalar); }
/**
* Composes two transformations.
*