def lineIntersection(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>if _near(old_div(float(e), b), old_div(float(f), d)):<EOL><INDENT>px = x1<EOL>py = y1<EOL><DEDENT>else:<EOL><INDENT>return None<EOL><DEDENT><DEDENT>else:<EOL><INDENT>t = old_div((e * d - b * f), denom)<EOL>px = x1 + t * (x2 - x1)<EOL>py = y1 + t * (y2 - y1)<EOL><DEDENT>return px, py<EOL>
Return the coordinates of a point of intersection given two lines.
Return None if the lines are parallel, but non-colli_near.
Return an arbitrary point of intersection if the lines are colli_near.

Parameters:
line1 and line2: lines given by 2 points (a 2-tuple of (x,y)-coords).