RE: function centroid as mean