code: public void rotateAtomContainer(IAtomContainer ac) {
          Point3d[] p = getPoint3dArray(ac);
          for (int i = 0; i < ac.getAtomCount(); i++) {
              // translate the the origin we have calculated
              p[i].x = p[i].x - this.cm2.x;
              p[i].y = p[i].y - this.cm2.y;
              p[i].z = p[i].z - this.cm2.z;
  
              // do the actual rotation
              ac.getAtom(i).setPoint3d(
                      new Point3d(U[0][0] * p[i].x + U[0][1] * p[i].y + U[0][2] * p[i].z, U[1][0] * p[i].x + U[1][1]
                              * p[i].y + U[1][2] * p[i].z, U[2][0] * p[i].x + U[2][1] * p[i].y + U[2][2] * p[i].z));
          }
      }
docs: Rotates the {@link IAtomContainer} coordinates by the rotation matrix.
  
  In general if you align a subset of atoms in a AtomContainer
  this function can be applied to the whole AtomContainer to rotate all
  atoms. This should be called with the second AtomContainer (or Atom[])
  that was passed to the constructor.
  
  Note that the AtomContainer coordinates also get translated such that the
  center of mass of the original fragment used to calculate the alignment is at the origin.
  
  @param ac The {@link IAtomContainer} whose coordinates are to be rotated