code: public double getMinimumDistance(double x0, double y0)
      {
          double min = Double.MAX_VALUE;
          int rows = points.numRows;
          double[] d = points.data;
          double x1 = d[2 * (rows - 1)];
          double y1 = d[2 * (rows - 1) + 1];
          for (int r = 0; r < rows; r++)
          {
              double x2 = d[2 * r];
              double y2 = d[2 * r + 1];
              min=Math.min(min, distanceFromLine(x0, y0, x1, y1, x2, y2));
              x1 = x2;
              y1 = y2;
          }
          if (min > 0 && !isInside(x0, y0))
          {
              throw new IllegalArgumentException("point not inside convex polygon");
          }
          return min;
      }
docs: Returns minimum distance from inside point (x0, y0) to edge.
  @param x0
  @param y0
  @return