def distance(line, point):
x0, y0, x1, y1 = line<EOL>try:<EOL><INDENT>p1, p2 = point<EOL><DEDENT>except ValueError:<EOL><INDENT>p1, p2 = middle(point)<EOL><DEDENT>n1 = ascent(line)<EOL>n2 = -<NUM_LIT:1><EOL>n0 = y0 - n1 * x0<EOL>return abs(n1 * p1 + n2 * p2 + n0) / (n1 ** <NUM_LIT:2> + n2 ** <NUM_LIT:2>) ** <NUM_LIT:0.5><EOL>
infinite line to point or line to line distance
is point is given as line - use middle point of that liune