[wpimath] Add Rotation2d.fromRadians factory (#4178)

This commit is contained in:
Starlight220
2022-04-30 10:19:29 +03:00
committed by GitHub
parent 4f79ceedd9
commit 18ff694f02
2 changed files with 12 additions and 2 deletions

View File

@@ -58,6 +58,16 @@ public class Rotation2d implements Interpolatable<Rotation2d> {
m_value = Math.atan2(m_sin, m_cos);
}
/**
* Constructs and returns a Rotation2d with the given radian value.
*
* @param radians The value of the angle in degrees.
* @return The rotation object with the desired angle value.
*/
public static Rotation2d fromRadians(double radians) {
return new Rotation2d(radians);
}
/**
* Constructs and returns a Rotation2d with the given degree value.
*