static void lower_tangent edge r_cw_l point edge l_ccw_r point edge l_

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
static void lower_tangent(edge *r_cw_l, point *s, edge *l_ccw_r, point *u,
edge **l_lower, point **org_l_lower,
edge **r_lower, point **org_r_lower)
{
edge *l, *r;
point *o_l, *o_r, *d_l, *d_r;
boolean finished;
l = r_cw_l;
r = l_ccw_r;
o_l = s;
d_l = Other_point(l, s);
o_r = u;
d_r = Other_point(r, u);
finished = FALSE;
while (!finished)
if (Cross_product_3p(o_l, d_l, o_r) > 0.0) {
l = Prev(l, d_l);
o_l = d_l;
d_l = Other_point(l, o_l);
} else if (Cross_product_3p(o_r, d_r, o_l) < 0.0) {
r = Next(r, d_r);
o_r = d_r;
d_r = Other_point(r, o_r);
} else
finished = TRUE;
*l_lower = l;
*r_lower = r;
*org_l_lower = o_l;
*org_r_lower = o_r;
}