def distance_to_line ( a , b , p ) : return distance ( closest_point ( a , b , p ) , p )
shortest distance to line python
Closest distance between a line segment and a point
def distance_to_line(a, b, p):
    """Closest distance between a line segment and a point

    Args:
        a ([float, float]): x and y coordinates. Line start
        b ([float, float]): x and y coordinates. Line end
        p ([float, float]): x and y coordinates. Point to compute the distance
    Returns:
        float
    """
    return distance(closest_point(a, b, p), p)