Skip to content

Commit

Permalink
Minor fix for Math Value Error on Alpha Shapes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sieboldianus committed Jan 30, 2018
1 parent 0965156 commit 9361e68
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion generateTagClusters.py
Expand Up @@ -1266,7 +1266,10 @@ def add_edge(edges, edge_points, coords, i, j):
# Semiperimeter of triangle
s = (a + b + c)/2.0
# Area of triangle by Heron's formula
area = math.sqrt(s*(s-a)*(s-b)*(s-c))
try:
area = math.sqrt(s*(s-a)*(s-b)*(s-c))
except ValueError:
return False
if area == 0:
return False
circum_r = a*b*c/(4.0*area)
Expand Down

0 comments on commit 9361e68

Please sign in to comment.