Fix slope calculation
This commit is contained in:
@@ -142,7 +142,10 @@ def _angle_of_node_link(node: str, link: str, nodes, links) -> float:
|
||||
n2 = links[link]['node1'] if n1 == links[link]['node2'] else links[link]['node2']
|
||||
x1, y1 = nodes[n1]['x'], nodes[n1]['y']
|
||||
x2, y2 = nodes[n2]['x'], nodes[n2]['y']
|
||||
v = _normal((x2 - x1, y2 - y1))
|
||||
if y1 == y2:
|
||||
v = ((x2 - x1) / abs(x2 - x1), 0.0)
|
||||
else:
|
||||
v = _normal((x2 - x1, y2 - y1))
|
||||
return _angle(v)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user