From 321a2c52b3a2e79507727b1f664bc281bbde4ee0 Mon Sep 17 00:00:00 2001 From: Army Date: Sat, 18 Nov 2023 12:18:03 +0800 Subject: [PATCH] fix: typo --- src/math/bezier.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/math/bezier.js b/src/math/bezier.js index f1089eeb..58c45f47 100644 --- a/src/math/bezier.js +++ b/src/math/bezier.js @@ -287,8 +287,8 @@ function pointAtBezierWithLength(points, length, percent = 1, maxIteration = 20, // Newton 法 let derivative1 = norm(at(approachT, points, 1)); // 1 阶导数 let derivative2 = norm(at(approachT, points, 2)); // 2 阶导数 - let numerator = 2 * d * derivative1; - let denominator = 2 * d * derivative2 + derivative1 * derivative1; + let numerator = d * derivative1; + let denominator = d * derivative2 + derivative1 * derivative1; approachT = approachT - numerator / denominator; if(Math.abs(approachT - preApproachT) < eps) { break;