2 ms·
unit 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 -> (
by TheRealPomax 11y ago
unit 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.