1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-09-25 23:59:02 +02:00

rotation minimizing frames

This commit is contained in:
Pomax
2020-08-15 11:08:11 -07:00
parent d8b8397326
commit 2bb9813af4
19 changed files with 1091 additions and 584 deletions

View File

@@ -522,9 +522,13 @@ class GraphicsAPI extends BaseAPI {
i2 = ne - ns,
p = v - s;
let r = ns + (p * i2) / i1;
if (constrain) r = r < ns ? ns : r > ne ? ne : r;
if (constrain) return this.constrain(r, ns, ne);
return r;
}
constrain(v, s, e) {
return v < s ? s : v > e ? e : v;
}
}
export { GraphicsAPI, Bezier, Vector, Matrix };