|
A=(sqrt(5)+1)/2;
x=0;
y=0;
for n=1:50
k1=A^n;
k2=A^(n-1);
As=(k1-k2)*sin((n-1)*pi/2); Ac= (k1-k2)*cos((n-1)*pi/2);t=n*pi/2:pi/1024:n*pi/2+pi/2;l=length(t);
c=k1*cos(t);
s=k1 *sin(t);
As=As*ones(1,l);
Ac=Ac*ones(1,l);
x=c+x+As;
y=s+y-Ac;
plot(x,y,'linewidth',2); hold on
x=x-c;
y=y-s;
end
axis equal
grid on |
|