Skip to content

Commit 7e0fe0e

Browse files
author
Simon Lammer
committed
Format melkman algorithm code
1 parent 6492d4b commit 7e0fe0e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: divide_and_conquer/convex_hull.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,10 @@ def convex_hull_melkman(points):
464464
i += 1
465465

466466
for i in range(i, n):
467-
if (_det(convex_hull[0], convex_hull[-1], points[i]) > 0
468-
and _det(convex_hull[-1], convex_hull[0], points[1]) < 0):
467+
if (
468+
_det(convex_hull[0], convex_hull[-1], points[i]) > 0
469+
and _det(convex_hull[-1], convex_hull[0], points[1]) < 0
470+
):
469471
# The point lies within the convex hull
470472
continue
471473

@@ -479,6 +481,7 @@ def convex_hull_melkman(points):
479481
# `convex_hull` is contains the convex hull in circular order
480482
return sorted(convex_hull[1:] if len(convex_hull) > 3 else convex_hull)
481483

484+
482485
def main():
483486
points = [
484487
(0, 3),

0 commit comments

Comments
 (0)