Running into a strange bug, but it reproduces reliably. When I have straight lines intersecting a circle, all of the intersections are detected no problem, but when the lines are curved (in this case with a Math.sin) Turf doesn't properly catch all the intersections.
Here's an example with straight lines:

And here's the same thing with curvy lines (with misses in red):

Here's a p5.js playground link which reproduces the bug in the latest version (6.X) of Turf.
If you change the size of the canvas, the misses change… some sizes have no errors (eg. 400x400) or some have just one (eg. 450x450) or some have many errors (eg. 500x500). It makes me think it has something to do with float-based arithmetic? But that's just a random guess.
What's going on here?
Running into a strange bug, but it reproduces reliably. When I have straight lines intersecting a circle, all of the intersections are detected no problem, but when the lines are curved (in this case with a
Math.sin) Turf doesn't properly catch all the intersections.Here's an example with straight lines:
And here's the same thing with curvy lines (with misses in red):
Here's a p5.js playground link which reproduces the bug in the latest version (6.X) of Turf.
If you change the size of the canvas, the misses change… some sizes have no errors (eg.
400x400) or some have just one (eg.450x450) or some have many errors (eg.500x500). It makes me think it has something to do with float-based arithmetic? But that's just a random guess.What's going on here?