code: def cross_section_components(data_x, data_y, index='index'):
      r
      # Get the unit vectors
      unit_tang, unit_norm = unit_vectors_from_cross_section(data_x, index=index)
  
      # Take the dot products
      component_tang = data_x * unit_tang[0] + data_y * unit_tang[1]
      component_norm = data_x * unit_norm[0] + data_y * unit_norm[1]
  
      # Reattach units (only reliable attribute after operation)
      component_tang.attrs = {'units': data_x.attrs['units']}
      component_norm.attrs = {'units': data_x.attrs['units']}
  
      return component_tang, component_norm
docs: r"""Obtain the tangential and normal components of a cross-section of a vector field.
  
      Parameters
      ----------
      data_x : `xarray.DataArray`
          The input DataArray of the x-component (in terms of data projection) of the vector
          field.
      data_y : `xarray.DataArray`
          The input DataArray of the y-component (in terms of data projection) of the vector
          field.
  
      Returns
      -------
      component_tangential, component_normal: tuple of `xarray.DataArray`
          The components of the vector field in the tangential and normal directions,
          respectively.
  
      See Also
      --------
      tangential_component, normal_component
  
      Notes
      -----
      The coordinates of `data_x` and `data_y` must match.