Skip to content

Commit

Permalink
Fix for issue 7390
Browse files Browse the repository at this point in the history
  • Loading branch information
akshayah3 committed Apr 10, 2014
1 parent 3633e72 commit d88f9cf
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sympy/geometry/polygon.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,13 @@ def __new__(cls, *args, **kwargs):
got.add(p)
i = -3
while i < len(nodup) - 3 and len(nodup) > 2:
a, b, c = sorted(
[nodup[i], nodup[i + 1], nodup[i + 2]], key=default_sort_key)
a, b, c = nodup[i], nodup[i + 1], nodup[i + 2]
if b not in shared and Point.is_collinear(a, b, c):
nodup[i] = a
nodup[i + 1] = None
nodup.pop(i + 1)
i += 1

vertices = list(filter(lambda x: x is not None, nodup))
vertices = list(nodup)

if len(vertices) > 3:
rv = GeometryEntity.__new__(cls, *vertices, **kwargs)
Expand Down

0 comments on commit d88f9cf

Please sign in to comment.