72 #define D ((ax2 - ax1) * (by1 - by2) - (ay2 - ay1) * (bx1 - bx2))
73 #define D1 ((bx1 - ax1) * (by1 - by2) - (by1 - ay1) * (bx1 - bx2))
74 #define D2 ((ax2 - ax1) * (by1 - ay1) - (ay2 - ay1) * (bx1 - ax1))
85 double bx1,
double by1,
double bx2,
double by2,
86 double *ra,
double *rb,
double *
x,
double *y)
90 if (ax1 > ax2 || (ax1 == ax2 && ay1 > ay2)) {
95 if (bx1 > bx2 || (bx1 == bx2 && by1 > by2)) {
106 *
x = ax1 + (*ra) * (ax2 - ax1);
107 *y = ay1 + (*ra) * (ay2 - ay1);
108 return (*ra >= 0.0 && *ra <= 1.0 && *rb >= 0.0 && *rb <= 1.0);
145 if (ay1 > by1 && ay1 < by2) {
181 if (ax1 > bx1 && ax1 < bx2) {
int G_intersect_line_segments(double ax1, double ay1, double ax2, double ay2, double bx1, double by1, double bx2, double by2, double *ra, double *rb, double *x, double *y)