code: public void addPoint(double x, double y)
      {
          if (npoints >= xpoints.length)
          {
              final int newLength = npoints * 2;
              xpoints = Arrays.copyOf(xpoints, newLength);
              ypoints = Arrays.copyOf(ypoints, newLength);
          }
          xpoints[npoints] = x;
          ypoints[npoints] = y;
          npoints++;
          updateBounds();
      }
docs: Add a point to the polygon.
  
  @param x The horizontal location.
  @param y The vertical location.