Microsoft Small Basic

Program Listing: QSF666
' Fermat's spiral Challenge of the Month - June 2016 by NaochanON

GraphicsWindow.Show()
GraphicsWindow.Width=800
GraphicsWindow.Height=700
GraphicsWindow.Left=5
GraphicsWindow.Top=5
GraphicsWindow.PenColor="Red"
GraphicsWindow.PenWidth=10
base=0.0000000001 ' to avoid zero dividion // Math.Arctan( zero )
stp=0.05
a=70
X0=400
Y0=350
X1=X0
Y1=Y0
For s=0 To 25 Step stp
r= Math.SquareRoot(a*a*s)
X=X0+r*math.Cos(-s)
Y=Y0+r*math.Sin(-s)
GraphicsWindow.DrawLine(x,y,X1,Y1)
sita= math.Floor(math.GetDegrees(Math.ArcTan((Y-Y0)/(X-X0+base)))*10)/10
L1=L1+ Math.SquareRoot((X-X1)*(X-X1)+ (Y-Y1)*(Y-Y1))
'GraphicsWindow.Title="radias= "+math.Floor(r)+" Length= "+math.Floor(L1)
X1=X
Y1=Y
Program.Delay(10)
EndFor
Program.Delay(1000)
GraphicsWindow.PenColor="Blue"
X1=X0
Y1=Y0
For s=0 To 25 Step stp
r= Math.SquareRoot(a*a*s)
X=X0+r*math.Cos(-s-3.14192)
Y=Y0+r*math.Sin(-s-3.14192)
GraphicsWindow.DrawLine(x,y,X1,Y1)
sita= math.Floor(math.GetDegrees(Math.ArcTan((Y-Y0)/(X-X0+base)))*10)/10
L2=L2+ Math.SquareRoot((X-X1)*(X-X1)+ (Y-Y1)*(Y-Y1))
' GraphicsWindow.Title="radias= "+math.Floor(r)+" Length= "+math.Floor(L2)
X1=X
Y1=Y
Program.Delay(10)
EndFor

GraphicsWindow.Title=" Points= "+math.floor(25/stp)+" Length 1= "+Math.Floor(L1)+" Length 2= "+Math.Floor(L2)+" : radias= "+math.Floor(r)