
The Archimedean spiral is a spiral named after the Greek mathematician Archimedes.



An Archimedean spiral can be described by the equation:






r
=
a
+
b
θ


{\displaystyle \,r=a+b\theta }


with real numbers a and b.



Task
Draw an Archimedean spiral.




 
module Archimedean_spiral {
	smooth on ' enable GDI+
	def r(θ)=5+3*θ
	cls #002222,0
	pen #FFFF00
	refresh 5000
	every 1000 {
		\\ redifine window (console width and height) and place it to center (symbol ;)
		Window 12, random(10, 18)*1000, random(8, 12)*1000;
		move scale.x/2, scale.y/2
		let N=2, k1=pi/120, k=k1, op=5, op1=1
		for i=1 to int(1200*min.data(scale.x, scale.y)/18000)
			pen op
			swap op, op1
			Width 3 {draw angle k, r(k)*n}
			k+=k1
		next
		refresh 5000
		\\ press space to exit loop
		if  keypress(32) then exit
	}
	pen 14
	cls 5
	refresh 50
}
Archimedean_spiral
 