mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpimath] Add Rotation2d.fromRadians factory (#4178)
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user