code: def find_dist_to_centroid(cvects, idx_list, weights=None):
      
      centroid = find_centroid(cvects, idx_list, weights)
      dist_vals = np.degrees(np.arccos((centroid * cvects.T[idx_list]).sum(1)))
      return dist_vals, centroid
docs: Find the centroid for a set of vectors
  
      Parameters
      ----------
      cvects : ~numpy.ndarray(3,nsrc) with directional cosine (i.e., x,y,z component) values
  
      idx_list : [int,...]
        list of the source indices in the cluster
  
      weights : ~numpy.ndarray(nsrc) with the weights to use.  None for equal weighting
  
      returns (np.ndarray(nsrc)) distances to the centroid (in degrees)