public static final Atom [ ] centerAtoms ( Atom [ ] atomSet , Atom centroid ) throws StructureException { Atom shiftVector = getCenterVector ( atomSet , centroid ) ; Atom [ ] newAtoms = new AtomImpl [ atomSet . length ] ; for ( int i = 0 ; i < atomSet . length ; i ++ ) { Atom a = atomSet [ i ] ; Atom n = add ( a , shiftVector ) ; newAtoms [ i ] = n ; } return newAtoms ; }
Center the atoms at the Centroid if the centroid is already know .