mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Check for denominator == 0 with tolerance.
This commit is contained in:
parent
0366752a6f
commit
10e1417dc2
1 changed files with 1 additions and 1 deletions
|
@ -196,7 +196,7 @@ var PathFitter = Base.extend({
|
||||||
// Compute f(u)/f'(u)
|
// Compute f(u)/f'(u)
|
||||||
var V = Q_u.subtract(P),
|
var V = Q_u.subtract(P),
|
||||||
df = Q1_u.dot(Q1_u) + V.dot(Q2_u);
|
df = Q1_u.dot(Q1_u) + V.dot(Q2_u);
|
||||||
if (df == 0)
|
if (Math.abs(df) < Numerical.TOLERANCE)
|
||||||
return u;
|
return u;
|
||||||
// u = u - f(u) / f'(u)
|
// u = u - f(u) / f'(u)
|
||||||
return u - V.dot(Q1_u) / df;
|
return u - V.dot(Q1_u) / df;
|
||||||
|
|
Loading…
Reference in a new issue