MCPcopy Create free account
hub / github.com/ShahjalalShohag/code-library / edge_cmp

Function edge_cmp

Geometry/Point Location.cpp:32–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30 PT l, r;
31};
32bool edge_cmp(edge* edge1, edge* edge2) {
33 const PT a = edge1->l, b = edge1->r;
34 const PT c = edge2->l, d = edge2->r;
35 int val = sign(a.cross(b, c)) + sign(a.cross(b, d));
36 if (val != 0) return val > 0;
37 val = sign(c.cross(d, a)) + sign(c.cross(d, b));
38 return val < 0;
39}
40enum EventType { DEL = 2, ADD = 3, GET = 1, VERT = 0 };
41struct Event {
42 EventType type; int pos;

Callers

nothing calls this directly

Calls 2

signFunction · 0.70
crossMethod · 0.45

Tested by

no test coverage detected