A short try with MetaPost:
% settings for the latexmp package
input latexmp;
setupLaTeXMP(textextlabel=enable);
mark_size := 2mm; % size of right angle's markings
u = 2cm; % unit length;
pair v; % for labels
% Macro producing the right angle symbol
% picked up in André Heck's "Tutorial in MetaPost"
vardef right_angle(expr endofa, common, endofb) =
save tn; tn := turningnumber(common--endofa--endofb--cycle);
((1, 0)--(1,1)--(0,1))
zscaled (mark_size * unitvector((1+tn)*endofa+(1-tn)*endofb-2*common))
shifted common
enddef;
% My try
beginfig(1);
z1 = (u, 0); draw origin -- z1; labeloffset := 3bp; label.top("$1$", 0.5z1);
for i = 2 upto 12:
z[i] = z[i-1] + u*unitvector(z[i-1] rotated 90);
draw z[i-1] -- z[i] -- origin;
draw right_angle(origin, z[i-1] , z[i]);
v := 0.5[z[i-1],z[i]];
labeloffset := 6bp;
label("$1$", origin) shifted (v + labeloffset*unitvector(v));
labeloffset := 9bp;
label("$\sqrt{"& decimal(i) & "}$", origin)
shifted (0.5z[i] + labeloffset*unitvector(z[i]) rotated 90);
endfor;
endfig;
end.
Run MetaPost twice, with LaTeX as typesetting engine, to make the labels appear (the price to pay to latexmp for its much more flexible gestion of labels):
mpost --tex=latex spirale.mp
UPDATE I have put the above code into a (probably clumsy) vardef macro, to be reused more easily, and added the colors :-)
% settings for the latexmp package
input latexmp;
setupLaTeXMP(options="11pt", textextlabel=enable);
% parameters
mark_size := 2mm; % size of right angle's markings
u = 2.5cm; % unit length;
% Macro producing the right angle symbol
% picked up in André Heck's "Tutorial in MetaPost"
vardef right_angle(expr endofa, common, endofb) =
save tn; tn := turningnumber(common--endofa--endofb--cycle);
((1, 0)--(1,1)--(0,1))
zscaled (mark_size * unitvector((1+tn)*endofa+(1-tn)*endofb-2*common))
shifted common
enddef;
vardef spirale (expr start, n) =
save v; pair v; clearxy;
image(z1 = start; draw origin -- z1; labeloffset:=3bp; label.top("$1$", 0.5z1);
for i = 2 upto n:
if i=n: drawoptions(withcolor red) fi;
z[i] = z[i-1] + u*unitvector(z[i-1] rotated 90);
draw z[i-1] -- z[i] -- origin;
draw right_angle(origin, z[i-1] , z[i]) withcolor black;
v := 0.5[z[i-1], z[i]];
labeloffset := 6bp;
label("$1$", origin) shifted (v + labeloffset*unitvector(v));
labeloffset := 10bp;
if (i < n):
label("$\sqrt{"& decimal(i) & "}$", origin)
shifted (0.5z[i] + labeloffset*unitvector(z[i]) rotated 90)
else:
label("$\sqrt x$", origin)
shifted (0.5z[i] + labeloffset*unitvector(z[i]) rotated 90)
fi;
endfor;
drawoptions();)
enddef;
beginfig(1);
draw spirale((u, 0), 2);
draw spirale((u, 0), 3) shifted (4cm, 0);
draw spirale((u, 0), 4) shifted (9cm, 0);
draw spirale((u, 0), 13) shifted (8cm, -6cm);
endfig;
end.