Added a method to calculate the center of the particles positions