xxxxxxxxxx
def gen(max=Infinity):
n=1; xyn=[0.,0.]
while n<=max:
yield xyn; n+=1; xn,yn=xyn[0],xyn[1]
xyn=[1-.2*xn^2+yn,.9991*xn]
N=3000; XY=gen(N); XYN=[el for el in XY]
cools=[colormaps.cool(1.*i/N)[:3] for i in [1..N]]
(polygon([[-5,-5],[-5,5],[5,5],[5,-5],[-5,-5]],
color='silver',alpha=.1)+\
sum([point([XYN[i]],size=1,color=cools[i])
for i in [1..N-1]])).show(axes=False)
No comments:
Post a Comment