code: def wind_components(speed, wdir):
      r
      wdir = _check_radians(wdir, max_radians=4 * np.pi)
      u = -speed * np.sin(wdir)
      v = -speed * np.cos(wdir)
      return u, v
docs: r"""Calculate the U, V wind vector components from the speed and direction.
  
      Parameters
      ----------
      speed : array_like
          The wind speed (magnitude)
      wdir : array_like
          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 array_like
          The wind components in the X (East-West) and Y (North-South)
          directions, respectively.
  
      See Also
      --------
      wind_speed
      wind_direction
  
      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')>)