Hi George,
Mathematically, radius of gyration is pretty simple.  From Wikipedia:  radius of gyration is the root mean square distance of the object's parts from its center of mass.  Looking at the script, perhaps the radius of gyration computation should not be mass weighted.  The script I’ve attached eliminates that mass weighting.  Let me know if that gives the results you expect.

—Eric

Eric Pettersen
UCSF Computer Graphics Lab