% pythspira pythagoreische Schnecke 
%  Spiralform aus lauter rechtwinkligen Dreiecken
ntot=30; n=1:ntot; r = sqrt(n) 
dw = atan2(ones(1,ntot),r);  s = 0;
for k=1:ntot; w(k) = s; s = s + dw(k); end
dw, w
vx = r.*cos(w); vy = r.*sin(w); 
mx = [ vx; zeros(1,ntot); vx];
my = [ vy; zeros(1,ntot); vy];
plx=reshape(mx,1,3*ntot); ply=reshape(my,1,3*ntot); 
plot(plx,ply,'linewidth',2); axis([-5.2 5.2 -5.2 5.2])
axis square; axis off
