code: private void bend(int[] indexes, int from, int to, IAtom pivotAtm, double r) {
          double s = Math.sin(r);
          double c = Math.cos(r);
          Point2d pivot = pivotAtm.getPoint2d();
          for (int i = from; i < to; i++) {
              Point2d p = mol.getAtom(indexes[i]).getPoint2d();
              double x = p.x - pivot.x;
              double y = p.y - pivot.y;
              double nx = x * c + y * s;
              double ny = -x * s + y * c;
              p.x = nx + pivot.x;
              p.y = ny + pivot.y;
          }
      }
docs: Bend select atoms around a provided pivot by the specified amount (r).
  
  @param indexes  array of atom indexes
  @param from     start offset into the array (inclusive)
  @param to       end offset into the array (exclusive)
  @param pivotAtm the point about which we are pivoting
  @param r        radians to bend by