Skip to content

Commit

Permalink
slight simplification to newtonRaphsonRootFind() (soswow#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yay295 authored and Sphinxxxx committed Jun 27, 2017
1 parent 6241d07 commit 3636363
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fit-curve.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ function newtonRaphsonRootFind(bez, point, u) {

var d = maths.subtract(bezier.q(bez, u), point),
qprime = bezier.qprime(bez, u),
numerator = /*sum(*/maths.mulMatrix(d, qprime)/*)*/,
denominator = maths.sum(maths.addItems( maths.squareItems(qprime), maths.mulMatrix(d, bezier.qprimeprime(bez, u)) ));
numerator = maths.mulMatrix(d, qprime),
denominator = maths.sum(maths.squareItems(qprime)) + 2 * maths.mulMatrix(d, bezier.qprimeprime(bez, u));

if (denominator === 0) {
return u;
Expand Down

0 comments on commit 3636363

Please sign in to comment.