Microsoft Small Basic

Program Listing: KCK850
gw = 500
gh = 500
GraphicsWindow.Width = gw
GraphicsWindow.Height = gh
width = 8 'Line widths
loops = 10 'Number of spirals
colours = 8 '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 = 2*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