import math
def distance(pointx, pointy, x1,y1,x2,y2):
a = y2 - y1
b = x1 - x2
x = x2 * y1 - x * y2
dis = (math.fabs(a * pointx + b * pointy + x )) / (math.pow(a * a + b * b, 0.5)
return dis
import math
def distance(pointx, pointy, x1,y1,x2,y2):
a = y2 - y1
b = x1 - x2
x = x2 * y1 - x * y2
dis = (math.fabs(a * pointx + b * pointy + x )) / (math.pow(a * a + b * b, 0.5)
return dis