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

Method orientation

src/main/java/com/thealgorithms/geometry/Point.java:22–24  ·  view source on GitHub ↗
(Point a, Point b, Point c)

Source from the content-addressed store, hash-verified

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);
24 }
25
26 private final class PolarOrder implements Comparator<Point> {
27 @Override

Callers 7

testOrientationMethod · 0.95
checkPointOrientationMethod · 0.95
convexHullRecursiveMethod · 0.95
constructHullMethod · 0.95
sortCounterClockwiseMethod · 0.95
GrahamScanMethod · 0.95
compareMethod · 0.45

Calls 1

compareMethod · 0.45

Tested by 1

testOrientationMethod · 0.76