How to find number of intersections between polyline and given horizontal line?Horizontal line starts from x1 and ends at x2. I think it is about segment trees but I dont know how to implement.
Asked
Active
Viewed 103 times
1
-
Dealing with polyline is not trivial. I suggest using a library for example [clipper](http://www.angusj.com/delphi/clipper.php). – BlueTune Mar 14 '20 at 14:31
-
Duplicate, and from an ongoing contest at that: https://stackoverflow.com/questions/60632867/how-many-line-segments-will-intersect-in-a-plane-will-intersect-with-a-horizonta/60634971 – Matt Timmermans Mar 14 '20 at 14:35