Skip to content

Commit

Permalink
codespell and linting
Browse files Browse the repository at this point in the history
  • Loading branch information
videlec committed Nov 12, 2023
1 parent 1878b98 commit 51b3d3d
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions flatsurf/geometry/categories/dilation_surfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ def _delaunay_edge_needs_flip_Linfinity(self, p1, e1, p2, e2):
Return whether the provided edge which bounds two triangles should be flipped
to get closer to the L-infinity Delaunay decomposition.
The return code is either ``0``: no flip needed, ``2``: filp needed to make
The return code is either ``0``: no flip needed, ``2``: flip needed to make
it veering, ``1``: flip needed to make it L-infinity.
TESTS::
Expand Down Expand Up @@ -477,19 +477,16 @@ def _delaunay_edge_needs_flip_Linfinity(self, p1, e1, p2, e2):
edge1new = edge2L + edge1R
xnew = abs(edge1new[0])
ynew = abs(edge1new[1])
monochromatic1 = s == s1L == s1R
monochromatic2 = s == s2L == s2R
monochromatic = (s == s1L == s1R) + (s == s2L == s2R)

# 1. flip to turn to a veering triangulation
if monochromatic1 or monochromatic2:
if monochromatic:
# monochromatic triangle
m = max(x, y)
mnew = max(xnew, ynew)
snew = slope(edge1new)
new_monochromatic1 = snew == s1L == s1R
new_monochromatic2 = snew == s2L == s2R
needs_flip = ((new_monochromatic1 + new_monochromatic2 < monochromatic1 + monochromatic2) or
(new_monochromatic1 + new_monochromatic2 == monochromatic1 + monochromatic2 and mnew < m))
new_monochromatic = (snew == s1L == s1R) + (snew == s2L == s2R)
needs_flip = new_monochromatic < monochromatic or (new_monochromatic == monochromatic and mnew < m)
return 2 if needs_flip else 0

# 2. flip to turn to the l-infinity delaunay
Expand Down

0 comments on commit 51b3d3d

Please sign in to comment.