Python Turtle Graphic Design #9
Source code:
import turtle as t
import colorsys as cs
from math import sin,cos,radians
t.setup(640,640)
t.bgcolor('black')
t.tracer(5)
t.pensize(1)
t.up()
k=6
r=1
i=0
while True:
t.color(cs.hls_to_rgb(r/25,0.5,1))
R = k*r
a =radians(i)
x = R*cos(a)+r*cos(R*a)
y = R*sin(a)-r*sin(R*a)
t.goto(x,y)
t.down()
i+=1
r+=0.005
if r>50:
break
t.done()
No comments:
Post a Comment