Skip to content

Commit

Permalink
sum absolute angle values ref #14256
Browse files Browse the repository at this point in the history
Signed-off-by: m-kro <m.barthauer@t-online.de>
  • Loading branch information
m-kro committed Jan 24, 2024
1 parent 89eea45 commit f8d160c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/sumolib/geomhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ def isWithin(pos, shape):
for i in range(0, len(shape) - 1):
p1 = ((shape[i][0] - pos[0]), (shape[i][1] - pos[1]))
p2 = ((shape[i + 1][0] - pos[0]), (shape[i + 1][1] - pos[1]))
angle = angle + angle2D(p1, p2)
angle += math.fabs(angle2D(p1, p2))
i = len(shape) - 1
p1 = ((shape[i][0] - pos[0]), (shape[i][1] - pos[1]))
p2 = ((shape[0][0] - pos[0]), (shape[0][1] - pos[1]))
angle = angle + angle2D(p1, p2)
return math.fabs(angle) >= math.pi
angle += math.fabs(angle2D(p1, p2))
return angle >= math.pi


def sideOffset(fromPos, toPos, amount):
Expand Down

0 comments on commit f8d160c

Please sign in to comment.