mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-03-13 16:33:28 -04:00
Fix check for quadratic curve by using the right coefficient (a instead of d), and checking with tolerance.
This commit is contained in:
parent
ccd4113ba3
commit
99f6597615
1 changed files with 1 additions and 1 deletions
|
@ -155,7 +155,7 @@ var Numerical = new function() {
|
|||
solveCubic: function(a, b, c, d, tolerance) {
|
||||
// After Numerical Recipes in C, 2nd edition, Press et al.,
|
||||
// 5.6, Quadratic and Cubic Equations
|
||||
if (d == 0)
|
||||
if (abs(a) < tolerance)
|
||||
return Numerical.solveQuadratic(b, c, d, tolerance);
|
||||
// Normalize
|
||||
b /= a;
|
||||
|
|
Loading…
Reference in a new issue