works for one sensor
This commit is contained in:
7
trigo.py
7
trigo.py
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user