calculate barycenter of the cluster to set a center