Line interesection transversal
===

I have several lines. And lines are random. I have to check if there any intersection between any two line. Lines may be connected or not.  What would be best algorithm for this problem. 

Code Example is much appreciated. 
