import math


def check_obst(x1, y1, x2, y2, ox, oy):
    """Check the distance of intersection between a line from (x1,y1) to (x2,y2) and a point (ox,oy).
     The point represents the origin of the obstacle."""
    a = y1 - y2
    b = x2 - x1
    c = (x1-x2)*y1 + x1*(y2-y1)
    dist = ((abs(a * ox + b * oy + c))/math.sqrt(a * a + b * b))
    return dist