Convert wind speed in m/s to knots

This commit is contained in:
XANTRONIX 2025-02-26 18:25:22 -05:00
parent 0aedd959f9
commit d1921d2d0b

View file

@ -18,6 +18,9 @@ def radians(degrees: float) -> float:
def degrees(radians: float) -> float:
return (radians * (180.0 / math.pi)) - 90
def knots(ms: float) -> float:
return ms * 1.944
class Hodograph():
def __init__(self, width, height):
self.width = min(width, height)
@ -151,7 +154,8 @@ class Hodograph():
if sx_last is not None and sy_last is not None:
cr.move_to(x + sx_last, x + sy_last)
sx, sy = self.sample_to_screen(sample.wind_speed, sample.wind_dir)
sx, sy = self.sample_to_screen(knots(sample.wind_speed),
sample.wind_dir)
if first:
cr.move_to(x + sx, y + sy)