Diff
Not logged in

Differences From Artifact [81dbefbd30f15e79]:

To Artifact [bec880bc3280bac9]:


12 12 b -= a; c -= a; 13 13 if( outer_prod(b,c) > 0 ) return +1; // counter clockwise 14 14 if( outer_prod(b,c) < 0 ) return -1; // clockwise 15 15 if( inner_prod(b,c) < 0 ) return +2; // c--[a--b] on line 16 16 if( norm(b) < norm(c) ) return -2; // [a--b]--c on line 17 17 return 0; // [a--c--b] on line 18 18 } 19 + 20 + 21 +// intersection of two line segments. 22 +bool cross(CMP p1, CMP p2, CMP P1, CMP P2) { 23 + return ccw(p1,p2,P1)*ccw(p1,p2,P2)<=0 && ccw(P1,P2,p1)*ccw(P1,P2,p2)<=0; 24 +}