Sweep Line Algorithm For Segment Intersection