I have been trying to learn this algorithm from this https://www.hackerearth.com/practice/math/geometry/line-intersection-using-bentley-ottmann-algorithm/tutorial/. But there is no clear implementation. I have failed to implement it. Does anyone have a good implementation. It will be very helpful.