mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Remove unnecessary calculation
This commit is contained in:
parent
c0a5739254
commit
0050984d83
1 changed files with 1 additions and 5 deletions
|
@ -318,7 +318,7 @@ var Numerical = new function() {
|
||||||
qd = (tmp + b1) * x + c2;
|
qd = (tmp + b1) * x + c2;
|
||||||
q = c2 * x + d;
|
q = c2 * x + d;
|
||||||
// Get a good initial approximation.
|
// Get a good initial approximation.
|
||||||
t = q /a;
|
t = q / a;
|
||||||
r = pow(abs(t), 1/3);
|
r = pow(abs(t), 1/3);
|
||||||
s = t < 0 ? -1 : 1;
|
s = t < 0 ? -1 : 1;
|
||||||
t = -qd / a;
|
t = -qd / a;
|
||||||
|
@ -337,10 +337,6 @@ var Numerical = new function() {
|
||||||
// Newton's. Divide by ec to avoid x0 crossing over a
|
// Newton's. Divide by ec to avoid x0 crossing over a
|
||||||
// root.
|
// root.
|
||||||
x0 = qd === 0 ? x : x - q / qd / ec;
|
x0 = qd === 0 ? x : x - q / qd / ec;
|
||||||
if (x0 === x) {
|
|
||||||
x = x0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} while (s * x0 > s * x);
|
} while (s * x0 > s * x);
|
||||||
// Adjust the coefficients for the quadratic.
|
// Adjust the coefficients for the quadratic.
|
||||||
if (abs(a) * x * x > abs(d / x)) {
|
if (abs(a) * x * x > abs(d / x)) {
|
||||||
|
|
Loading…
Reference in a new issue