diff --git a/lib/xmet/thermo.py b/lib/xmet/thermo.py index e06a7b5..c0fe75a 100644 --- a/lib/xmet/thermo.py +++ b/lib/xmet/thermo.py @@ -189,3 +189,9 @@ def follow_saturated_mixing_ratio(temp: float, pressure: float, step: float=1.0) p2 -= step return series + +def wind_u(speed: float, direction: float) -> float: + return speed * math.cos(rad(direction)) + +def wind_v(speed: float, direction: float) -> float: + return -speed * math.sin(rad(direction))