diff options
author | Akshay <[email protected]> | 2021-04-07 14:37:33 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2021-04-07 14:37:33 +0100 |
commit | f57f03cd87d205d8304008d08c05f53c34b44435 (patch) | |
tree | e1a1da435a4ae8a21209c304d15130d254be7c97 /src/bitmap.rs | |
parent | c84c38544bc6e81f0b0482e4e82b6c95848c1a0c (diff) |
use floating angles
Diffstat (limited to 'src/bitmap.rs')
-rw-r--r-- | src/bitmap.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bitmap.rs b/src/bitmap.rs index 2f96a99..ba5c8f1 100644 --- a/src/bitmap.rs +++ b/src/bitmap.rs | |||
@@ -325,11 +325,11 @@ pub fn reflect_figure(figure: &[MapPoint], around: MapPoint) -> Vec<MapPoint> { | |||
325 | figure.iter().map(|pt| pt.reflect(around)).collect() | 325 | figure.iter().map(|pt| pt.reflect(around)).collect() |
326 | } | 326 | } |
327 | 327 | ||
328 | pub fn positive_angle_with_x(start: MapPoint, end: MapPoint) -> u32 { | 328 | pub fn positive_angle_with_x(start: MapPoint, end: MapPoint) -> f64 { |
329 | if end.x == start.x { | 329 | if end.x == start.x { |
330 | return 90; | 330 | return 90.; |
331 | } | 331 | } |
332 | let numer = (end.y as f64 - start.y as f64).abs(); | 332 | let numer = (end.y as f64 - start.y as f64).abs(); |
333 | let denum = (end.x as f64 - start.x as f64).abs(); | 333 | let denum = (end.x as f64 - start.x as f64).abs(); |
334 | (numer / denum).atan().to_degrees() as u32 | 334 | (numer / denum).atan().to_degrees() |
335 | } | 335 | } |