Add spin mode to ferris example 🦀

This commit is contained in:
Héctor Ramón Jiménez 2024-05-03 07:23:55 +02:00
parent eac5bcb64f
commit 4010e3983d
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
4 changed files with 87 additions and 16 deletions

View file

@ -31,6 +31,13 @@ impl Rotation {
}
}
/// Returns a mutable reference to the angle of the [`Rotation`] in [`Radians`].
pub fn radians_mut(&mut self) -> &mut Radians {
match self {
Rotation::Floating(radians) | Rotation::Solid(radians) => radians,
}
}
/// Returns the angle of the [`Rotation`] in [`Degrees`].
pub fn degrees(self) -> Degrees {
Degrees(self.radians().0.to_degrees())