code: public static Point2d get2DCenter(Iterator<IAtom> atoms) {
          IAtom atom;
          double xsum = 0;
          double ysum = 0;
          int length = 0;
          while (atoms.hasNext()) {
              atom = (IAtom) atoms.next();
              if (atom.getPoint2d() != null) {
                  xsum += atom.getPoint2d().x;
                  ysum += atom.getPoint2d().y;
              }
              ++length;
          }
          return new Point2d(xsum / (double) length, ysum / (double) length);
      }
docs: Calculates the center of the given atoms and returns it as a Point2d.
  See comment for center(IAtomContainer atomCon, Dimension areaDim, HashMap renderingCoordinates) for details on coordinate sets
  
  @param  atoms  The Iterator of the given atoms
  @return        The center of the given atoms as Point2d