rem Start of BASIC! Program FN.DEF bezier1(p1x,p1y,s1x,s1y,s2x,s2y,p2x,p2y) n=(HYPOT(s1x-p1x,s1y-p1y)+ HYPOT(s2x-s1x,s2y-s1y)+ HYPOT(p2x-s2x,p2y-s2y))/20 ox=p1x oy=p1y FOR i=0 TO 1 STEP 1/n x1=p1x+(s1x-p1x)*i y1=p1y+(s1y-p1y)*i x2=s1x+(s2x-s1x)*i y2=s1y+(s2y-s1y)*i x3=s2x+(p2x-s2x)*i y3=s2y+(p2y-s2y)*i x4=x1+(x2-x1)*i y4=y1+(y2-y1)*i x5=x2+(x3-x2)*i y5=y2+(y3-y2)*i x=x4+(x5-x4)*i y=y4+(y5-y4)*i GR.LINE vd,ox,oy,x,y ox=x oy=y NEXT i GR.LINE vd,ox,oy,p2x,p2y FN.END totalcur=1 GR.OPEN 255,255,255,255,0,1 dim l[100] dim glox[100] dim gloy[100] GR.SCREEN sx,sy do gr.touch yyy,x,y until yyy sx=x sy=y glox[totalcur]=INT(sx/10*1) gloy[totalcur]=INT(sy/20*8) glox[totalcur+1]=INT(sx/10*6) gloy[totalcur+1]=INT(sy/20*9) glox[totalcur+2]=INT(sx/10*4) gloy[totalcur+2]=INT(sy/20*13) glox[totalcur+3]=INT(sx/10*8) gloy[totalcur+3]=INT(sy/20*10) DO GR.CLS GR.TEXT.SIZE sy/30 GR.TEXT.ALIGN 2 GR.SET.STROKE 1 for i=1 to totalcur GR.COLOR 255,0,255+i,0,1 gr.circle vd,glox,gloy,sx/100 next i GR.SET.STROKE 6 for i=1 to totalcur step 1 bezier1(glox,gloy,glox[i+1],gloy[i+1],glox[i+2],gloy[i+2],glox[i+3],gloy[i+3] ) next i GR.RENDER GR.TOUCH tt,tx,ty IF tt&!ott THEN for i=1 to totalcur step 1 l=HYPOT(tx- glox,ty-gloy) next i ARRAY.MIN amin,l[] ARRAY.SEARCH l[],amin,p ELSEIF tt&ott THEN glox[p] =INT(tx/20)*20 gloy[p] =INT(ty/20)*20 endif ott=tt UNTIL 0