/** * Returns the quadratic radius of gyration of the ensemble of specified particles * * @param relevantParticles * @return */ private double computeRadiusOfGyration(ArrayList<IParticle> relevantParticles) { // compute center of mass double[] centerOfMass = computeCenterOfMass(relevantParticles); double rog = 0; for (IParticle p : relevantParticles) { double norm = DoubleArrays.norm(DoubleArrays.subtract(p.get_coords(), centerOfMass)); rog += norm * norm; } return rog / relevantParticles.size(); }