65 if (e1->
reg[1] == e2->
reg[1])
68 d = e1->
a * e2->
b - e1->
b * e2->
a;
69 if (-1.0e-10 < d && d < 1.0e-10)
72 xint = (e1->
c * e2->
b - e2->
c * e1->
b) / d;
73 yint = (e2->
c * e1->
a - e1->
c * e2->
a) / d;
84 right_of_site = xint >= e->
reg[1]->
coord.
x;
85 if ((right_of_site && el->
ELpm ==
le) || (!right_of_site && el->
ELpm ==
re))
101 double dxp, dyp, dxs, t1, t2, t3, yl;
105 bool right_of_site = p->
x > topsite->
coord.
x;
106 if (right_of_site && el->
ELpm ==
le)
108 if (!right_of_site && el->
ELpm ==
re)
115 if ((!right_of_site && e->
b < 0.0) || (right_of_site && e->
b >= 0.0)) {
116 above = dyp >= e->
b * dxp;
119 above = p->
x + p->
y * e->
b > e->
c;
127 above = e->
b * (dxp * dxp - dyp * dyp) <
128 dxs * dyp * (1.0 + 2.0 * dxp / dxs + e->
b * e->
b);
133 yl = e->
c - e->
a * p->
x;
136 t3 = yl - topsite->
coord.
y;
137 above = t1 * t1 > t2 * t2 + t3 * t3;
139 return el->
ELpm ==
le ? above : !above;
Memory allocation wrappers that exit on failure.
static void * gv_calloc(size_t nmemb, size_t size)
static Halfedge ** ELhash
Halfedge * ELright(Halfedge *he)
void ELinsert(Halfedge *lb, Halfedge *new)
Site * hintersect(Halfedge *el1, Halfedge *el2)
Halfedge * ELleftbnd(Point *p)
Site * rightreg(Halfedge *he)
Halfedge * ELleft(Halfedge *he)
Halfedge * HEcreate(Edge *e, char pm)
static Halfedge * ELgethash(int b)
int right_of(Halfedge *el, Point *p)
void ELdelete(Halfedge *he)
Site * leftreg(Halfedge *he)
void * getfree(Freelist *)
void makefree(void *, Freelist *)
void freeinit(Freelist *, int)
struct Halfedge * ELright