mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
No need to check solutions for bounds again.
This commit is contained in:
parent
efaae89dfc
commit
814512f562
1 changed files with 3 additions and 3 deletions
|
@ -229,10 +229,10 @@ var Numerical = new function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isFinite(x1) && (min == null || x1 >= min && x1 <= max))
|
if (isFinite(x1) && (min == null || x1 >= min && x1 <= max))
|
||||||
roots[nRoots++] = x1 < min ? min : x1 > max ? max : x1;
|
roots[nRoots++] = x1;
|
||||||
if (x2 !== x1
|
if (x2 !== x1
|
||||||
&& isFinite(x2) && (min == null || x2 >= min && x2 <= max))
|
&& isFinite(x2) && (min == null || x2 >= min && x2 <= max))
|
||||||
roots[nRoots++] = x2 < min ? min : x2 > max ? max : x2;
|
roots[nRoots++] = x2;
|
||||||
return nRoots;
|
return nRoots;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ var Numerical = new function() {
|
||||||
var nRoots = Numerical.solveQuadratic(a, b1, c2, roots, min, max);
|
var nRoots = Numerical.solveQuadratic(a, b1, c2, roots, min, max);
|
||||||
if (isFinite(x) && (nRoots === 0 || x !== roots[nRoots - 1])
|
if (isFinite(x) && (nRoots === 0 || x !== roots[nRoots - 1])
|
||||||
&& (min == null || x >= min && x <= max))
|
&& (min == null || x >= min && x <= max))
|
||||||
roots[nRoots++] = x < min ? min : x > max ? max : x;
|
roots[nRoots++] = x;
|
||||||
return nRoots;
|
return nRoots;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue