From 57ce901c01e823e80adb6bafe1ca3cda20944d88 Mon Sep 17 00:00:00 2001 From: XANTRONIX Industrial Date: Wed, 19 Mar 2025 11:38:45 -0400 Subject: [PATCH] Better readability --- lib/xmet/thermo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/xmet/thermo.py b/lib/xmet/thermo.py index c4fe55f..b4d0d9d 100644 --- a/lib/xmet/thermo.py +++ b/lib/xmet/thermo.py @@ -194,10 +194,10 @@ def follow_saturated_mixing_ratio(temp: float, pressure: float, step: float=1.0) return series def wind_u(speed: float, direction: float) -> float: - return speed * math.cos(rad(direction)) + return math.cos(rad(direction)) * speed def wind_v(speed: float, direction: float) -> float: - return -speed * math.sin(rad(direction)) + return math.sin(rad(direction)) * -speed def wind_uv(speed: float, direction: float) -> float: return ( @@ -208,5 +208,5 @@ def wind_uv(speed: float, direction: float) -> float: def wind_speed_dir(u: float, v: float) -> float: return ( math.sqrt(u**2 + v**2), - (180 - deg(math.atan2(v, u))) % 360 + (deg(math.atan2(v, u)) - 180) % 360 )