add "check if two given line segments intersect" algorithm, from:
http://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/