51 #define D ((ax2-ax1)*(by1-by2) - (ay2-ay1)*(bx1-bx2))
53 #define D1 ((bx1-ax1)*(by1-by2) - (by1-ay1)*(bx1-bx2))
55 #define D2 ((ax2-ax1)*(by1-ay1) - (ay2-ay1)*(bx1-ax1))
59 double ax2,
double ay2,
60 double bx1,
double by1,
double bx2,
double by2)
62 register double d, d1, d2;
70 return (d1 >= 0 && d2 >= 0 && d >= d1 && d >= d2);
72 return (d1 <= 0 && d2 <= 0 && d <= d1 && d <= d2);
96 if (ax1 == bx2 || ax2 == bx1)
104 double ax2,
double ay2,
105 double bx1,
double by1,
106 double bx2,
double by2,
double *x,
double *
y)
108 register double d, r1, r2;
117 if (r1 < 0 || r1 > 1 || r2 < 0 || r2 > 1) {
120 *x = ax1 + r1 * (ax2 - ax1);
121 *y = ay1 + r1 * (ay2 - ay1);
int dig_find_intersection(double ax1, double ay1, double ax2, double ay2, double bx1, double by1, double bx2, double by2, double *x, double *y)
int dig_test_for_intersection(double ax1, double ay1, double ax2, double ay2, double bx1, double by1, double bx2, double by2)