code: private void snapBondToPosition(IAtom beg, IBond bond, Point2d tP) {
          IAtom end = bond.getOther(beg);
          Point2d bP = beg.getPoint2d();
          Point2d eP = end.getPoint2d();
          Vector2d curr = new Vector2d(eP.x-bP.x, eP.y-bP.y);
          Vector2d dest = new Vector2d(tP.x-bP.x, tP.y-bP.y);
          double theta = Math.atan2(curr.y, curr.x) - Math.atan2(dest.y, dest.x);
          double sin = Math.sin(theta);
          double cos = Math.cos(theta);
          bond.setFlag(CDKConstants.VISITED, true);
          Deque<IAtom> queue = new ArrayDeque<>();
          queue.add(end);
          while (!queue.isEmpty()) {
              IAtom atom = queue.poll();
              if (!atom.getFlag(CDKConstants.VISITED)) {
                  rotate(atom.getPoint2d(), bP, cos, sin);
                  atom.setFlag(CDKConstants.VISITED, true);
              }
              for (IBond b : container.getConnectedBondsList(atom))
                  if (!b.getFlag(CDKConstants.VISITED)) {
                      queue.add(b.getOther(atom));
                      b.setFlag(CDKConstants.VISITED, true);
                  }
          }
      }
docs: tP=target point