kopia lustrzana https://github.com/glidernet/python-ogn-client
put bearing into [0,360)
rodzic
3d36b88996
commit
e1c4623f64
|
@ -85,5 +85,5 @@ class CheapRuler():
|
||||||
dy = (b[1] - a[1]) * self.ky
|
dy = (b[1] - a[1]) * self.ky
|
||||||
if dx == 0 and dy == 0:
|
if dx == 0 and dy == 0:
|
||||||
return 0
|
return 0
|
||||||
else:
|
result = math.atan2(-dy, dx) * 180 / MATH_PI + 90
|
||||||
return math.atan2(-dy, dx) * 180 / MATH_PI + 90
|
return result if result >= 0 else result + 360
|
||||||
|
|
Ładowanie…
Reference in New Issue