code: public static float distancePointLine(float pointX, float pointY, float x0, float y0, float x1, float y1) {
          float dx = x1 - x0;
          float dy = y1 - y0;
          float denom = (float) Math.sqrt(dx * dx + dy * dy);
          return (dx * (y0 - pointY) - (x0 - pointX) * dy) / denom;
      }
docs: Determine the signed distance of the given point <code>(pointX, pointY)</code> to the line defined by the two points <code>(x0, y0)</code> and <code>(x1, y1)</code>.
  <p>
  Reference: <a href="http://mathworld.wolfram.com/Point-LineDistance2-Dimensional.html">http://mathworld.wolfram.com</a>
  
  @param pointX
  the x coordinate of the point
  @param pointY
  the y coordinate of the point
  @param x0
  the x coordinate of the first point on the line
  @param y0
  the y coordinate of the first point on the line
  @param x1
  the x coordinate of the second point on the line
  @param y1
  the y coordinate of the second point on the line
  @return the distance between the point and the line