version 6.30 0 Form1 1 16 0 0 0 5 0 0 1 0 0 0 0 4 0 0 0 0 0 0 238 268 C:\Basic4ppc\IconEditV1_3\troc.ico 0 0 0 Sub designer addform(Form1,"Rolling","",0,0,0)@ addbutton(form1,ButtonLift,165,10,45,20,"Lift",212,208,200,0,0,0,True,True,9)@ addbutton(form1,ButtonClr,190,215,45,20,"Clear",212,208,200,0,0,0,True,True,9)@ addbutton(form1,ButtonStop,30,10,40,20,"Exit",212,208,200,0,0,0,True,True,9)@ addbutton(form1,ButtonIO,5,215,30,20,"I/O",212,208,200,0,0,0,True,True,9)@ addbutton(form1,Slow,215,10,20,20,"-",212,208,200,0,0,0,True,True,9)@ addbutton(form1,Fast,5,10,20,20,"+",212,208,200,0,0,0,True,True,9)@ addbutton(form1,ButtonP,160,240,20,20,"P",255,166,0,0,0,0,True,True,9)@ addbutton(form1,ButtonL,80,240,20,20,"F",255,166,0,0,0,0,True,True,9)@ addbutton(form1,ButtonS,0,240,20,20,"M",255,166,0,0,0,0,True,True,9)@ addnum(form1,large,100,240,55,40,99,255,255,255,True,True)@ addnum(form1,small,25,240,55,10,100,255,255,255,True,True)@ addnum(form1,pole,180,240,55,10,10000,255,255,255,True,True)@ End Sub @EndOfDesignText@Sub Globals 'Declare the global variables here. Dim a, b, h, t, t1 Dim x, y, xstart, ystart Dim showsmall, showlarge, showpole Dim waittime, inner, draw Dim stop End Sub Sub App_Start ' Equations curtesy of mathworld.wolfram.com stop = False Form1.Color = cBlack xstart = 120 : ystart = 120 xsmall = xstart : ysmall = ystart a=40:b=10:h=10:t=0:x=0:y=0 showsmall=1 : showlarge=1 : showpole=1 waittime = 20 : inner = 1 : draw = 1 SetTransparentColor(cWhite) form1.ForeLayer = true Form1.Show t1=0 Do Until stop If showlarge = 1 Then form1.Circle(xstart,ystart,a,cGray) Else form1.Circle(xstart,ystart,a,cBlack) End If form1.FLine(0,0,400,400,cWhite,BF) t=t1*cPi/180 If inner = 1 Then z = a-b x=z*Cos(t)+h*Cos(z/b*t) Else z = a+b x=z*Cos(t)-h*Cos(z/b*t) End If y=z*Sin(t)-h*Sin(z/b*t) xsmall=z*Cos(t) ysmall=z*Sin(t) If draw = 1 Then form1.Line(xstart+x,ystart+y,xstart+x+1,ystart+y+1,cWhite,BF) end if If showsmall = 1 Then form1.FCircle(xstart+xsmall,ystart+ysmall,b,cGray) End If If showpole = 1 Then form1.FLine(xstart+xsmall,ystart+ysmall,xstart+x,ystart+y,cRed) End If DoEvents Sleep(waittime) t1 = t1 + 1 Loop End Sub Sub Form1_Close stop = True End Sub Sub pole_ValueChanged 'form1.Line(0,0,400,400,cBlack,BF) h=pole.Value t1=0 End Sub Sub large_ValueChanged 'form1.Line(0,0,400,400,cBlack,BF) form1.Circle(xstart,ystart,a,cBlack) a=large.Value t1=0 End Sub Sub small_ValueChanged 'form1.Line(0,0,400,400,cBlack,BF) b=small.Value h=b pole.Value = b t1=0 End Sub Sub ButtonS_Click If showsmall = 1 Then showsmall = 0 ButtonS.Color = cWhite Else showsmall = 1 ButtonS.Color = cOrange End If End Sub Sub ButtonL_Click If showlarge = 1 Then showlarge = 0 ButtonL.Color = cWhite Else showlarge = 1 ButtonL.Color = cOrange End If End Sub Sub ButtonP_Click If showpole = 1 Then showpole = 0 ButtonP.Color = cWhite Else showpole = 1 ButtonP.Color = cOrange End If End Sub Sub Fast_Click If waittime > 1 Then waittime = Int(waittime/2) End If End Sub Sub Slow_Click waittime = waittime * 2 End Sub Sub ButtonIO_Click If inner = 1 Then inner = 0 Else inner = 1 End If 'form1.Line(0,0,400,400,cBlack,BF) t1=0 End Sub Sub ButtonStop_Click AppClose End Sub Sub ButtonClr_Click form1.Line(0,0,400,400,cBlack,BF) t1=0 End Sub Sub ButtonLift_Click If draw = 0 Then draw = 1 ButtonLift.Text = "Lift" Else draw = 0 ButtonLift.Text = "Draw" End If End Sub