// the commented code below is functionally equal to a one-liner library call in the end /* double rmsd = 0; for (int i = 0; i < size; i++) { Atom atomLeft = listLeft.get(i); Atom atomRight = listRight.get(i); double distance = calculateDistance(atomLeft, atomRight); rmsd += distance * distance; } rmsd /= size; rmsd = Math.sqrt(rmsd); */ double rmsd = SVDSuperimposer.getRMS(atomSet1, atomSet2);