[librsvg] Angle::from_degrees(): Use f64::to_radians()
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] Angle::from_degrees(): Use f64::to_radians()
- Date: Mon, 10 Dec 2018 17:33:42 +0000 (UTC)
commit 9eba059b8d1d206c1a23c258b128850aa20f1b13
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Dec 10 11:32:13 2018 -0600
Angle::from_degrees(): Use f64::to_radians()
The libcore implementation does
let value: f64 = consts::PI;
self * (value / 180.0)
I wonder if parenthesizing the second term is more numerically stable
or something.
rsvg_internals/src/marker.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/rsvg_internals/src/marker.rs b/rsvg_internals/src/marker.rs
index 149eda85..88faa874 100644
--- a/rsvg_internals/src/marker.rs
+++ b/rsvg_internals/src/marker.rs
@@ -597,7 +597,7 @@ impl Angle {
}
pub fn from_degrees(deg: f64) -> Angle {
- Angle(Angle::normalize(deg * PI / 180.0))
+ Angle(Angle::normalize(deg.to_radians()))
}
pub fn from_vector(vx: f64, vy: f64) -> Angle {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]