// /usr/libexec/gcc/i686-pc-linux-gnu/3.4.3-20050110/cc1 -quiet -I. -I. -I../.. -I../.. -I../../dynagraph -I../../cdt -I../../agraph -MD .libs/xlines.d -MF .deps/xlines.Tpo -MP -MT xlines.lo -MQ .libs/xlines.o -DHAVE_CONFIG_H -DPIC xlines.c -mno-sse2 -fstack-protector -fstack-protector-all -quiet -dumpbase xlines.c -march=pentium3 -auxbase-strip .libs/xlines.o -g -O2 -Wall -fPIC -o - -frandom-seed=0 # 1 "xlines.c" # 1 "/var/tmp/portage/graphviz-1.16/work/graphviz-1.16/dynagraph/common//" # 1 "" # 1 "" # 1 "xlines.c" # 54 "xlines.c" int gems_lines_intersect( x1, y1, x2, y2, x3, y3, x4, y4, x, y ) double x1, y1, x2, y2, x3, y3, x4, y4, *x, *y; { double a1, a2, b1, b2, c1, c2; double r1, r2, r3, r4; double denom, offset, num; a1 = y2 - y1; b1 = x1 - x2; c1 = x2 * y1 - x1 * y2; r3 = a1 * x3 + b1 * y3 + c1; r4 = a1 * x4 + b1 * y4 + c1; if ( r3 != 0 && r4 != 0 && ((r3 >= 0.0) == (r4 >= 0.0))) return ( 0 ); a2 = y4 - y3; b2 = x3 - x4; c2 = x4 * y3 - x3 * y4; r1 = a2 * x1 + b2 * y1 + c2; r2 = a2 * x2 + b2 * y2 + c2; if ( r1 != 0 && r2 != 0 && ((r1 >= 0.0) == (r2 >= 0.0))) return ( 0 ); denom = a1 * b2 - a2 * b1; if ( denom == 0 ) return ( 2 ); offset = denom < 0 ? - denom / 2 : denom / 2; offset = 0.0; num = b1 * c2 - b2 * c1; *x = ( num < 0 ? num - offset : num + offset ) / denom; num = a2 * c1 - a1 * c2; *y = ( num < 0 ? num - offset : num + offset ) / denom; return ( 1 ); }