// 2-Bezier(x1,y1,x2,y2,x3,y3,x4,y4,color) function bezier2(x1,y1,x2,y2,x3,y3,c){ var t=0,ox=x1,oy=y1,x,y; while(t<=10){ var tt=10-t; x=tt*tt*x1+2*tt*t*x2+t*t*x3; y=tt*tt*y1+2*tt*t*y2+t*t*y3; x=x/100; y=y/100; pc.line(ox,oy,x,y,c); ox=x;oy=y; t=t+1; } } // Sample Code var pc=new PanCake(); pc.reset(0); pc.clear(0); bezier2(0,20, 0,0, 20,0, 2);