code: def coords_to_vec(lon, lat):
      
      phi = np.radians(lon)
      theta = (np.pi / 2) - np.radians(lat)
      sin_t = np.sin(theta)
      cos_t = np.cos(theta)
  
      xVals = sin_t * np.cos(phi)
      yVals = sin_t * np.sin(phi)
      zVals = cos_t
  
      # Stack them into the output array
      out = np.vstack((xVals, yVals, zVals)).swapaxes(0, 1)
      return out
docs: Converts longitute and latitude coordinates to a unit 3-vector
  
      return array(3,n) with v_x[i],v_y[i],v_z[i] = directional cosines