adding a method to compute the centroid from a finite source