The radius of gyration of a polymer is defined as the average distance of monomers from the center of mass of the polymer.  Since the monomers used in this simulation all have the same mass, the center of mass is simplify the average position of all monomers.