Driver program to test above functions :
p1 = Point ( 1 , 1 ) NEW_LINE q1 = Point ( 10 , 1 ) NEW_LINE p2 = Point ( 1 , 2 ) NEW_LINE q2 = Point ( 10 , 2 ) NEW_LINE if doIntersect ( p1 , q1 , p2 , q2 ) : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT p1 = Point ( 10 , 0 ) NEW_LINE q1 = Point ( 0 , 10 ) NEW_LINE p2 = Point ( 0 , 0 ) NEW_LINE q2 = Point ( 10 , 10 ) NEW_LINE if doIntersect ( p1 , q1 , p2 , q2 ) : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT p1 = Point ( - 5 , - 5 ) NEW_LINE q1 = Point ( 0 , 0 ) NEW_LINE p2 = Point ( 1 , 1 ) NEW_LINE q2 = Point ( 10 , 10 ) NEW_LINE if doIntersect ( p1 , q1 , p2 , q2 ) : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT