works for one sensor

This commit is contained in:
2019-10-11 10:28:16 +02:00
parent 04222b6148
commit e18bd1aae6
2 changed files with 52 additions and 26 deletions

View File

@@ -10,6 +10,8 @@ def get_line_feats(point1, point2):
x1,y1 = point1
x2,y2 = point2
# if x1 == x2 :
# x1=x1+1
a = (y1-y2)/(x1-x2)
b = y2 - a * x2
return a,b
@@ -19,6 +21,11 @@ def get_line_feats(point1, point2):
def segments_intersection(line1, line2):
p1,p2 = line1
p3,p4 = line2
if p1[0] == p2[0] :
p1 = (p1[0] + 1, p1[1])
if p3[0] == p4[0] :
p3 = (p3[0] + 1, p3[1])
a1,b1 = get_line_feats(p1,p2)
a2,b2 = get_line_feats(p3,p4)