typo: quadratic -> cubic

This commit is contained in:
Ze-Zheng Wu
2022-03-21 19:05:03 +08:00
parent 6328b6fbe3
commit 3708402907
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ export function getBezierCenter({
y2: sourceY,
c: curvature,
});
// quadratic bezier t=0.5 mid point, not the actual mid point, but easy to calculate
// cubic bezier t=0.5 mid point, not the actual mid point, but easy to calculate
// https://stackoverflow.com/questions/67516101/how-to-find-distance-mid-point-of-bezier-curve
const centerX = sourceX * 0.125 + sourceControlX * 0.375 + targetControlX * 0.375 + targetX * 0.125;
const centerY = sourceY * 0.125 + sourceControlY * 0.375 + targetControlY * 0.375 + targetY * 0.125;
+1 -1
View File
@@ -91,7 +91,7 @@ export function getSimpleBezierCenter({
x2: sourceX,
y2: sourceY,
});
// quadratic bezier t=0.5 mid point, not the actual mid point, but easy to calculate
// cubic bezier t=0.5 mid point, not the actual mid point, but easy to calculate
// https://stackoverflow.com/questions/67516101/how-to-find-distance-mid-point-of-bezier-curve
const centerX = sourceX * 0.125 + sourceControlX * 0.375 + targetControlX * 0.375 + targetX * 0.125;
const centerY = sourceY * 0.125 + sourceControlY * 0.375 + targetControlY * 0.375 + targetY * 0.125;