square root spiral in python
square root spiral in python
t= turtle.Turtle()
t.pensize(2)
colors= ["gold", "orange", 'red', "maroon", "violet", "magenta", "purple", "navy", "blue", "skyblue", "cyan", "turquoise", "lightgreen", "green", "darkgreen",
"chocolate", "brown", "black", "gray"]
color= random.choice(colors)
t.pencolor(color)
t.forward(size*x) #size
t.left(90)
CONSOLE:
for i in range(times):
#append side values to list
sides.append((round(x, 3), y, round(c, 3)))
t.forward(size*y) #size
p=t.pos() #p is the current position of turtle
t.forward(size*c) #size
t.penup()
t.goto(p)
t.right(90)
x=c
c= math.sqrt((x**2)+(y**2))
t.pendown()