xxxxxxxxxx
def gen(a,b,max=Infinity):
n=1; xyn=[0.,0.]
while n<=max:
yield xyn; n+=1; xn,yn=xyn[0],xyn[1]
xyn=[(1+.01*a)*abs(xn)-(1+.00001*b)*yn+1,xn]
N,A,B=3000,7,5; XY=gen(A,B,N); XYN=[el for el in XY]
cols=[colormaps.autumn(1.*i/N)[:3] for i in [1..N]]
(polygon([[-5,-5],[-5,15],[15,15],[15,-5],[-5,-5]],
color='silver',alpha=.1)+\
sum([point([XYN[i]],size=1,color=cols[i])
for i in [1..N-1]])).show(axes=False)
No comments:
Post a Comment