so you want the rocls to rotate around a common center.

first add up all the positions in different components, then divide by the total number of rocks. Record the distance and angle of each rock from this center. Find the angle between the center and the mouse, add the rocks inital angle. Use sin and cos with the distance and angle to move the rocks.