def draw_cornu_bezier(x0, y0, t0, t1, s0, c0, flip, cs, ss, cmd, scale, rot):
s = None<EOL>for j in range(<NUM_LIT:0>, <NUM_LIT:5>):<EOL><INDENT>t = j * <NUM_LIT><EOL>t2 = t+ <NUM_LIT><EOL>curvetime = t0 + t * (t1 - t0)<EOL>curvetime2 = t0 + t2 * (t1 - t0)<EOL>Dt = (curvetime2 - curvetime) * scale<EOL>if not s:<EOL><INDENT>s, c = eval_cornu(curvetime)<EOL>s *= flip<EOL>s -= s0<EOL>c -= c0<EOL>dx1 =  cos(pow(curvetime, <NUM_LIT:2>) + (flip * rot))  <EOL>dy1 =  flip * sin(pow(curvetime, <NUM_LIT:2>) + (flip *rot))<EOL>x = ((c * cs - s * ss) +x0)<EOL>y = ((s * cs + c * ss) + y0)<EOL><DEDENT>s2,c2 = eval_cornu(curvetime2) <EOL>s2 *= flip<EOL>s2 -= s0<EOL>c2 -= c0<EOL>dx2 = cos(pow(curvetime2, <NUM_LIT:2>) + (flip * rot)) <EOL>dy2 = flip * sin(pow(curvetime2, <NUM_LIT:2>) + (flip * rot))<EOL>x3 = ((c2 * cs - s2 * ss)+x0)<EOL>y3 = ((s2 * cs + c2 * ss)+y0)<EOL>x1 = (x + ((Dt/<NUM_LIT>) * dx1))<EOL>y1 = (y + ((Dt/<NUM_LIT>) * dy1))   <EOL>x2 = (x3 - ((Dt/<NUM_LIT>) * dx2))<EOL>y2 = (y3 - ((Dt/<NUM_LIT>) * dy2))<EOL>if cmd == '<STR_LIT>':<EOL><INDENT>print_pt(x, y, cmd)<EOL>cmd = '<STR_LIT>'<EOL><DEDENT>print_crv(x1, y1, x2, y2, x3, y3)<EOL>dx1, dy1 = dx2, dy2<EOL>x,y = x3, y3<EOL><DEDENT>return cmd<EOL>
Mark Meyer's code draws elegant CURVETO segments.