code: public static Point3d get3DCenter(IAtomContainer ac) {
          double centerX = 0;
          double centerY = 0;
          double centerZ = 0;
          double counter = 0;
          for (IAtom atom : ac.atoms()) {
              if (atom.getPoint3d() != null) {
                  centerX += atom.getPoint3d().x;
                  centerY += atom.getPoint3d().y;
                  centerZ += atom.getPoint3d().z;
                  counter++;
              }
          }
          return new Point3d(centerX / (counter), centerY / (counter), centerZ / (counter));
      }
docs: Returns the geometric center of all the atoms in this atomContainer. See comment for
  center(IAtomContainer atomCon, Dimension areaDim, HashMap renderingCoordinates) for details
  on coordinate sets
  
  @param ac Description of the Parameter
  @return the geometric center of the atoms in this atomContainer