MCPcopy Create free account
hub / github.com/ActiveState/code / lineDis

Function lineDis

recipes/Python/576896_3_Point_Area_Finder/recipe-576896.py:3–10  ·  view source on GitHub ↗

slope in decimal, y intercept, (x,y)

(m,y,point)

Source from the content-addressed store, hash-verified

1def dis(a,b):
2 return ( (b[0]-a[0])**2 + (b[1]-a[1])**2 )**.5
3def lineDis(m,y,point):
4 """slope in decimal, y intercept, (x,y)"""
5 a = m
6 b = -1
7 c = y
8 m = point[0]
9 n = point[1]
10 return abs(a*m+b*n+c)/((a)**2+(b)**2)**.5
11def findMY(a,b):
12 """return slope(m), y intercept(y)"""
13 x1,y1,x2,y2 = a[0],a[1],b[0],b[1]

Callers 1

triAreaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected