mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 16:26:47 +08:00
Fixes: #413 Implemented Convex Hull using Graham Scan
This commit is contained in:
@ -18,7 +18,7 @@ function orientation (a, b, c) {
|
|||||||
|
|
||||||
// Clockwise
|
// Clockwise
|
||||||
if (alpha > beta) return 1
|
if (alpha > beta) return 1
|
||||||
// Anticlockwise
|
// Anticlockwise
|
||||||
else if (beta > alpha) return -1
|
else if (beta > alpha) return -1
|
||||||
// Colinear
|
// Colinear
|
||||||
return 0
|
return 0
|
||||||
@ -79,4 +79,4 @@ const points = [
|
|||||||
{ x: 3, y: 1 },
|
{ x: 3, y: 1 },
|
||||||
{ x: 3, y: 3 }]
|
{ x: 3, y: 3 }]
|
||||||
|
|
||||||
convexHull(points);
|
convexHull(points)
|
||||||
|
Reference in New Issue
Block a user