code: def radius_of_gyration(coords, periodic):
      '''Calculate the square root of the mean distance squared from the center of gravity.
  
      '''
      gc = geometric_center(coords, periodic)
      return (periodic_distance(coords, gc, periodic) ** 2).sum() / len(coordsf radius_of_gyration(coords, periodic):
      '''Calculate the square root of the mean distance squared from the center of gravity.
  
      '''
      gc = geometric_center(coords, periodic)
      return (periodic_distance(coords, gc, periodic) ** 2).sum() / len(coords)
docs: Calculate the square root of the mean distance squared from the center of gravity.