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 )