31 float a, b, c, d, e, f, g, h, t;
34 c =
after(l)->pos.x - a;
35 d =
after(l)->pos.y - b;
38 g =
after(m)->pos.x - a;
39 h =
after(m)->pos.y - b;
59static int between(
double f,
double g,
double h) {
111 }
else if (ms.
x == me.
x) {
117 c1 = ms.
y - m1 * ms.
x;
118 c2 = ls.
y - m2 * ls.
x;
119 *
x = (c2 - c1) / (m1 - m2);
120 *
y = (m1 * c2 - c1 * m2) / (m1 - m2);
125 if (
online(l, m, 0) == -1) {
127 pt2 =
online(m, l, 1) == -1 ? (
online(m, l, 0 == -1) ?
le : ls) : me;
128 }
else if (
online(l, m, 1) == -1) {
130 pt2 =
online(l, m, 0) == -1 ? (
online(m, l, 0) == -1 ?
le : ls) : ms;
133 if (
online(m, l, 0) != -1)
139 *
x = (pt1.
x + pt2.
x) / 2;
140 *
y = (pt1.
y + pt2.
y) / 2;
144 if ((ls.
x -
le.x) * (ms.
y - ls.
y) == (ls.
y -
le.y) * (ms.
x - ls.
x)) {
183 fprintf(stderr,
"\n**ERROR**\n using too many intersections\n");
static NORETURN void graphviz_exit(int status)
static int between(double f, double g, double h)
void find_intersection(struct vertex *l, struct vertex *m, struct intersection ilist[], struct data *input)
detect whether lines l and m intersect
static void sgnarea(struct vertex *l, struct vertex *m, int i[])
static int online(struct vertex *l, struct vertex *m, int i)
static int sign(double v)
static int intpoint(struct vertex *l, struct vertex *m, float *x, float *y, int cond)