Skip to content

Commit

Permalink
fixed ccw
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyBoivie authored and JimmyBoivie committed Dec 5, 2015
1 parent bf0be2a commit 3e557e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main/CompGeo.pde
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions main/main.pde
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3e557e1

Please sign in to comment.