MCPcopy Create free account
hub / github.com/Code-Bullet/Jump-King / getTatLen

Function getTatLen

libraries/p5.js:30221–30233  ·  view source on GitHub ↗
(x1, y1, x2, y2, x3, y3, x4, y4, ll)

Source from the content-addressed store, hash-verified

30219}
30220
30221function getTatLen(x1, y1, x2, y2, x3, y3, x4, y4, ll) {
30222 if (ll < 0 || bezlen(x1, y1, x2, y2, x3, y3, x4, y4) < ll) {
30223 return;
30224 }
30225 var t = 1, step = t / 2, t2 = t - step, l, e = 0.01;
30226 l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);
30227 while (Math.abs(l - ll) > e) {
30228 step /= 2;
30229 t2 += (l < ll ? 1 : -1) * step;
30230 l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);
30231 }
30232 return t2;
30233}
30234
30235function base3(t, p1, p2, p3, p4) {
30236 var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4,

Callers 1

getPointAtSegmentLengthFunction · 0.85

Calls 1

bezlenFunction · 0.85

Tested by

no test coverage detected