added stable versions (for degenerate triangles return the distance to the longest edge) for distPointTriangleSquared and distPointTriangle