3 ms·
This page really helped me wrap my head around Bezier curves. It's very well done. One thing, given all the live code on the site, it would be nice to have a l
by ant6n 11y ago
This page really helped me wrap my head around Bezier curves. It's very well done.
One thing, given all the live code on the site, it would be nice to have a live sample where one can select points and a t in [0, 1], and it shows it's coordinate along the line. I implemented a Bezier curve, and had trouble coming up with unit test samples.
- TheRealPomax 11y agounit tests are generally easiest to do with unit curves: (0,0)-(0,1)-(1,1)-(1,0) has well defined coordinates for many t values. t=0.5 -> (1/2,3/4), t=0.25 -> (5/32, 9/16), etc. If you need this for unit testing, hit up http://pomax.github.io/bezierjs http://pomax.github.io/bezierjs instead, open dev tools, type "var b = new Bezier(x1,y1,x2,y2,x3,y3,x4,y4)" with real values of course, and then check the coordinates you get for "b.get(0.5)", "b.get(0.25", etc.