var('t,k'); n=randint(16,24)
a,b,c=randint(8,16),randint(13,19),2*randint(3,6)
s1=r'<p style="color:#00aaff;">'
s2=r'$a=%d; \; b=%d; \; c=%d; \; n=%d$</p>'
pretty_print(html(s1+s2%(a,b,c,n)))
fy(t,k)=cos(pi*t/n+2*k*pi/c)
fy(t,k)=fy(t,k)+cos(a*pi*t/n+2*k*pi/c)+cos(b*pi*t/n+2*k*pi/c)
fx(t,k)=sin(pi*t/n+2*k*pi/c)
fx(t,k)=fx(t,k)-sin(a*pi*t/n+2*k*pi/c)+sin(b*pi*t/n+2*k*pi/c)
for t in range(2*n)] for k in range(2*c)]
sum([polygon2d(L[i],color=(0,random(),random()),
thickness=.5,alpha=.1,axes=False)
for i in range(2*c)]).show(figsize=6)
No comments:
Post a Comment