You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to #15 quadratic bezier intersection seems to struggle with straight lines.
One issue appears to be with the utils' "roots" function which I think is missing parenthesis on the divisor:
I.e. return [ (2*b-c)/2*(b-c) ].filter(reduce);
I think should be: return [ (2*b-c)/(2*(b-c)) ].filter(reduce);
Though my understanding of the maths isn't great so you'd want to double check that.
A second problem appears to be rounding issues again within the "utils.align" method.
My test data shows that the discriminant should be 0, however the "b" value is becoming -84.99999... instead of -85 which means d is no longer 0 and a different code path is taken.
I also wrote some tests to validate the scenarios, and I tried to push all this to open a pull request but wasn't able to (I'm new to this, do I need permissions??).
Similar to #15 quadratic bezier intersection seems to struggle with straight lines.
One issue appears to be with the utils' "roots" function which I think is missing parenthesis on the divisor:
I.e.
return [ (2*b-c)/2*(b-c) ].filter(reduce);
I think should be:
return [ (2*b-c)/(2*(b-c)) ].filter(reduce);
Though my understanding of the maths isn't great so you'd want to double check that.
A second problem appears to be rounding issues again within the "utils.align" method.
My test data shows that the discriminant should be 0, however the "b" value is becoming -84.99999... instead of -85 which means d is no longer 0 and a different code path is taken.
I also wrote some tests to validate the scenarios, and I tried to push all this to open a pull request but wasn't able to (I'm new to this, do I need permissions??).
The first 2 sets of points failed prior to the divisor fix, the fourth set of points still fails due to the rounding error.
Either way, thanks so much for the library, it's helped us a lot!
The text was updated successfully, but these errors were encountered: