mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
[wpimath] Add distance/angle constructor to Translation2d (#2791)
This commit is contained in:
committed by
GitHub
parent
b66fcdb3f7
commit
17698af5e3
@@ -40,6 +40,15 @@ class Translation2d {
|
||||
*/
|
||||
Translation2d(units::meter_t x, units::meter_t y);
|
||||
|
||||
/**
|
||||
* Constructs a Translation2d with the provided distance and angle. This is
|
||||
* essentially converting from polar coordinates to Cartesian coordinates.
|
||||
*
|
||||
* @param distance The distance from the origin to the end of the translation.
|
||||
* @param angle The angle between the x-axis and the translation vector.
|
||||
*/
|
||||
Translation2d(units::meter_t distance, const Rotation2d& angle);
|
||||
|
||||
/**
|
||||
* Calculates the distance between two translations in 2d space.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user