From 010a2650ae8141835da9121167023eaee0921af4 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Mon, 23 May 2022 16:19:34 +0200 Subject: [PATCH] Use standard library methods to simplify code --- crates/fj/src/angle.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/fj/src/angle.rs b/crates/fj/src/angle.rs index 4bef7caac..5ad919afa 100644 --- a/crates/fj/src/angle.rs +++ b/crates/fj/src/angle.rs @@ -17,7 +17,7 @@ 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 { @@ -25,7 +25,7 @@ impl Angle { } /// 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