draw_bezier

draw a bezier curve using 3 points x1,y1 x2,y2 x3,y3

Arguments

Returns : void

Source code

  1. var t,xx,yy;
  2. xp=argument0;
  3. yp=argument1;
  4. t=0;
  5. precision=20;
  6. repeat(precision+1){
  7.     xx=(1-t)*(1-t)*argument0  +  2*t*(1-t)*argument2  +  t*t*argument4;
  8.     yy=(1-t)*(1-t)*argument1  +  2*t*(1-t)*argument3  +  t*t*argument5;
  9.     draw_line(xp,yp,xx,yy);
  10.     xp=xx;
  11.     yp=yy;
  12.     t+=1/precision;
  13. }