def lineSeqmentsDoIntersect(line1, line2):
(x1, y1), (x2, y2) = line1<EOL>(u1, v1), (u2, v2) = line2<EOL>(a, b), (c, d) = (x2 - x1, u1 - u2), (y2 - y1, v1 - v2)<EOL>e, f = u1 - x1, v1 - y1<EOL>denom = float(a * d - b * c)<EOL>if _near(denom, <NUM_LIT:0>):<EOL><INDENT>return False<EOL><DEDENT>else:<EOL><INDENT>t = old_div((e * d - b * f), denom)<EOL>s = old_div((a * f - e * c), denom)<EOL>return <NUM_LIT:0> <= t <= <NUM_LIT:1> and <NUM_LIT:0> <= s <= <NUM_LIT:1><EOL><DEDENT>
Return True if line segment line1 intersects line segment line2 and
line1 and line2 are not parallel.