I believe at an interval should be divided by 4 (not 5) at refine-binary.js:22, for binary search.
An interval with 5 points: [t1, n1, n2, n3, t2] , then n1 should be t1 + (t2 - t1) / 4.
It is used from a sample code for Projecting a point onto a Bézier curve.
Another algorithm is used in Besier.project of besier-js so that this problem does not effect to besier-js (it use a simple linear search).
I believe at an interval should be divided by 4 (not 5) at refine-binary.js:22, for binary search.
An interval with 5 points: [
t1
,n1
,n2
,n3
,t2
] , thenn1
should bet1 + (t2 - t1) / 4
.It is used from a sample code for Projecting a point onto a Bézier curve. Another algorithm is used in
Besier.project
ofbesier-js
so that this problem does not effect tobesier-js
(it use a simple linear search).thank you for your works.