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
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
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)
form1.Line(xstart+x,ystart+y,xstart+x+1,ystart+y+1,cWhite,BF)
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