I am trying to implement the algorithm Wikipedia page. I also took a look at some open source repos.
However, my problem is that my code generates intersecting lines. Thi