We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6492d4b commit 7e0fe0eCopy full SHA for 7e0fe0e
divide_and_conquer/convex_hull.py
@@ -464,8 +464,10 @@ def convex_hull_melkman(points):
464
i += 1
465
466
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):
+ if (
+ _det(convex_hull[0], convex_hull[-1], points[i]) > 0
469
+ and _det(convex_hull[-1], convex_hull[0], points[1]) < 0
470
+ ):
471
# The point lies within the convex hull
472
continue
473
@@ -479,6 +481,7 @@ def convex_hull_melkman(points):
479
481
# `convex_hull` is contains the convex hull in circular order
480
482
return sorted(convex_hull[1:] if len(convex_hull) > 3 else convex_hull)
483
484
+
485
def main():
486
points = [
487
(0, 3),
0 commit comments