Skip to content

Commit

Permalink
Use standard library methods to simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun authored May 23, 2022
1 parent beb5736 commit 8aa467e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/fj/src/angle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ impl Angle {
}
/// Create a new angle specified in degrees
pub fn from_deg(deg: f64) -> Self {
Self::from_rad(deg * PI / 180.)
Self::from_rad(deg.to_radians())
}
/// Retrieve value of angle as radians
pub fn rad(&self) -> f64 {
self.rad
}
/// Retrieve value of angle as degrees
pub fn deg(&self) -> f64 {
self.rad / PI * 180.
self.rad.to_degrees()
}

// ensures that the angle is always 0 <= a < 2*pi
Expand Down

0 comments on commit 8aa467e

Please sign in to comment.