MCPcopy Create free account
hub / github.com/TheAlgorithms/Java / polarOrder

Method polarOrder

src/main/java/com/thealgorithms/geometry/Point.java:18–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16 }
17
18 public Comparator<Point> polarOrder() {
19 return new PolarOrder();
20 }
21
22 public static int orientation(Point a, Point b, Point c) {
23 return Integer.compare((b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x), 0);

Callers 3

testPolarOrderMethod · 0.95
testPolarOrderCompareMethod · 0.95
GrahamScanMethod · 0.80

Calls

no outgoing calls

Tested by 2

testPolarOrderMethod · 0.76
testPolarOrderCompareMethod · 0.76