code: public void setCorner(int index, double x, double y) {
          if (index <= 0) {
              this.x1 = x;
              this.y1 = y;
          } else if (index == 1) {
              this.x2 = x;
              this.y2 = y;
          } else if (index == 2) {
              this.x3 = x;
              this.y3 = y;
          } else if (index >= 3) {
              this.x4 = x;
              this.y4 = y;
          }
          calcG();
      }
docs: Sets x,y-coordinate of a corner.
  
  @param index The index of a corner.
  @param x The x-coordinate of a corner.
  @param y The y-coordinate of a corner.