Skip to content

Commit a105da7

Browse files
committed
fix is_counter_clockwise bug
1 parent 726cb79 commit a105da7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contents/graham_scan/code/nim/graham.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ proc tup_to_point[T](t: (T, T)): Point[T] =
99
(x: t[0], y: t[1])
1010

1111
proc is_counter_clockwise(p1, p2, p3: Point): bool =
12-
(p3.y - p1.y) * (p2.x - p1.x) >= (p2.y - p1.y) * (p3.x - p1.x)
12+
(p3.y - p1.y) * (p2.x - p1.x) < (p2.y - p1.y) * (p3.x - p1.x)
1313

1414
proc polar_angle(reference, point: Point): float =
1515
arctan2(float(point.y - reference.y), float(point.x - reference.x))

0 commit comments

Comments
 (0)