wind_components

metpy.calc.wind_components(speed, wdir)[source]

Calculate the U, V wind vector components from the speed and direction.

Parameters
  • speed (pint.Quantity) – The wind speed (magnitude)

  • wdir (pint.Quantity) – The wind direction, specified as the direction from which the wind is blowing (0-2 pi radians or 0-360 degrees), with 360 degrees being North.

Returns

u, v (tuple of pint.Quantity) – The wind components in the X (East-West) and Y (North-South) directions, respectively.

Examples

>>> from metpy.units import units
>>> metpy.calc.wind_components(10. * units('m/s'), 225. * units.deg)
(<Quantity(7.071067811865475, 'meter / second')>,
 <Quantity(7.071067811865477, 'meter / second')>)