Microsoft Small Basic

Program Listing: KCK850-0
gw = 700
gh = 700
GraphicsWindow.Width = gw
GraphicsWindow.Height = gh
width = 2 'Line widths
loops = 20 'Number of spirals
colours = 64 'Number of colours
GraphicsWindow.PenWidth = width

For col = 1 To colours
GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor()
offset = 2*Math.Pi*(col)/colours
Draw()
EndFor

Sub Draw
For i = 1 To 360*loops
angle = 1.98*Math.Pi*(i-width)/360
radius = (i-width)/360*width*colours
x0 = gw/2+radius*Math.Cos(angle+offset)
y0 = gh/2+radius*Math.Sin(angle+offset)

angle = 2*Math.Pi*(i+width)/360
radius = (i+width)/360*width*colours
x1 = gw/2+radius*Math.Cos(angle+offset)
y1 = gh/2+radius*Math.Sin(angle+offset)

GraphicsWindow.DrawLine(x0,y0,x1,y1)
EndFor
EndSub