<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

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(coords)