Returns the square distance between a segment and a point. To get the distance between a point and a line (with infinite length) use Utils#ptLineDist.

  • Parameters

    • x1: number

      X-coordinate of the startpoint of the segment.

    • y1: number

      Y-coordinate of the startpoint of the segment.

    • x2: number

      X-coordinate of the endpoint of the segment.

    • y2: number

      Y-coordinate of the endpoint of the segment.

    • px: number

      X-coordinate of the point.

    • py: number

      Y-coordinate of the point.

    Returns number