diff --git a/main/CompGeo.pde b/main/CompGeo.pde index 2c10bf6..882db8c 100644 --- a/main/CompGeo.pde +++ b/main/CompGeo.pde @@ -3,8 +3,8 @@ public static class CompGeo { public static int CCW(Point a, Point b, Point c) { // Return 1 if turn abc is ccw -1 if turn abc is cw 0 if no turn float f = (b.getX() - a.getX())*(c.getY() - a.getY()) - (c.getX() - a.getX())*(b.getY()-a.getY()); - if (f < 0) { return -1; } - if (f > 0) { return 1; } + if (f < 0) { return 1; } + if (f > 0) { return -1; } return 0; } diff --git a/main/main.pde b/main/main.pde index 5c0627e..e80363b 100644 --- a/main/main.pde +++ b/main/main.pde @@ -21,6 +21,7 @@ public void setup() { HalfEdge h2 = new HalfEdge(p1, p4); HalfEdge h3 = new HalfEdge(p3, p1); HalfEdge h4 = new HalfEdge(p1, p5); + HalfEdge h5 = new HalfEdge(p3, p4); h1.printFace(); //HalfEdge h5 = new HalfEdge(p5, p2); //h5.gettwin().printFace();