public static double rmsd ( Point3d [ ] x , Point3d [ ] y ) { if ( x . length != y . length ) { throw new IllegalArgumentException ( "Point arrays are not of the same length." ) ; } double sum = 0.0 ; for ( int i = 0 ; i < x . length ; i ++ ) { sum += x [ i ] . distanceSquared ( y [ i ] ) ; } return Math . sqrt ( sum / x . length ) ; }
Calculate the RMSD of two point arrays already superposed .