From e1c4623f64540fa89bf14cc9f236730650211c8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Gru=CC=88ndger?= Date: Mon, 12 Oct 2020 20:28:09 +0200 Subject: [PATCH] put bearing into [0,360) --- ogn/parser/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ogn/parser/utils.py b/ogn/parser/utils.py index b31b1e9..0624b5f 100644 --- a/ogn/parser/utils.py +++ b/ogn/parser/utils.py @@ -85,5 +85,5 @@ class CheapRuler(): dy = (b[1] - a[1]) * self.ky if dx == 0 and dy == 0: return 0 - else: - return math.atan2(-dy, dx) * 180 / MATH_PI + 90 + result = math.atan2(-dy, dx) * 180 / MATH_PI + 90 + return result if result >= 0 else result + 360