code: def com(points, masses=None):
      
      if masses is None:
          return np.average(points, axis=0)
      else:
          return np.average(points, axis=0, weights=masses)
docs: Calculate center of mass for given points.
      If masses is not set, assume equal masses.