diff options
| author | Martin Haug <mhaug@live.de> | 2022-03-17 10:50:51 +0100 |
|---|---|---|
| committer | Martin Haug <mhaug@live.de> | 2022-03-17 10:50:51 +0100 |
| commit | 6f5b721fe56fe6e3735d03b07e3716fc39572639 (patch) | |
| tree | 002ed75565e02baeb1ce1b9ec53f0a92491d17ab /src/geom | |
| parent | 4d617bcd67f9e42218da190dc9a0bf2f10d4b78d (diff) | |
CR: I'm gonna make him a refactor he can't refuse
Diffstat (limited to 'src/geom')
| -rw-r--r-- | src/geom/angle.rs | 4 | ||||
| -rw-r--r-- | src/geom/point.rs | 6 | ||||
| -rw-r--r-- | src/geom/transform.rs | 5 |
3 files changed, 4 insertions, 11 deletions
diff --git a/src/geom/angle.rs b/src/geom/angle.rs index 4e08a518..b4d6f79a 100644 --- a/src/geom/angle.rs +++ b/src/geom/angle.rs @@ -40,12 +40,12 @@ impl Angle { (self.0).0 } - /// Get the sine of this angle. + /// Get the sine of this angle in radians. pub fn sin(self) -> f64 { self.to_rad().sin() } - /// Get the cosine of this angle. + /// Get the cosine of this angle in radians. pub fn cos(self) -> f64 { self.to_rad().cos() } diff --git a/src/geom/point.rs b/src/geom/point.rs index 7ab0d375..6d77507b 100644 --- a/src/geom/point.rs +++ b/src/geom/point.rs @@ -49,12 +49,6 @@ impl Point { } } -impl From<Spec<Length>> for Point { - fn from(spec: Spec<Length>) -> Self { - Self::new(spec.x, spec.y) - } -} - impl Get<SpecAxis> for Point { type Component = Length; diff --git a/src/geom/transform.rs b/src/geom/transform.rs index eed51d46..5bc05d84 100644 --- a/src/geom/transform.rs +++ b/src/geom/transform.rs @@ -36,9 +36,8 @@ impl Transform { /// A rotation transform. pub fn rotation(angle: Angle) -> Self { - let v = angle.to_rad(); - let cos = Relative::new(v.cos()); - let sin = Relative::new(v.sin()); + let cos = Relative::new(angle.cos()); + let sin = Relative::new(angle.sin()); Self { sx: cos, ky: sin, |
