list order / draw-points joined



Hi,

I'm drawing circle l0 = {z:abs(z)=ER}
and its preimages :
 l1={z1=sqrt(z) }
 l2={z2:sqrt(z1)}
 ....

Program is below.
It works.
I can join points with lines only for first circle l0.
For its preimages no  probably because of bad order of points.

Can I order point according to it's argument ?
How can I improve the program ?

Thx in advance

Adam

=== code begin =====


radius:20;
iMax:100;
dt:float(1/iMax);

/* */
l(t):=radius*%e^(2*%pi*%i*t);

/* point to point method of drawing */
t:0; /* angle in turns */ 
w:rectform(ev(l(t), numer)); 
l0:makelist (w, j, 1, 1);

w:sqrt(w);
l1: makelist (w, j, 1, 1);
l1:endcons(-w,l1);

w:sqrt(w);
l2: makelist (w, j, 1, 1);
l2:endcons(-w,l2);

for i:1 thru iMax step 1 do
block
( 	t:t+dt,
	w0:rectform(ev(l(t), numer)), 
        l0:cons(w0,l0),

        w1:sqrt(w0),
        l1:cons(w1,l1),
        l1:endcons(-w1,l1),

        w2:sqrt(w1),
        l2:cons(w2,l2),
        l2:endcons(-w2,l2),
        w2:sqrt(-w1),
        l2:cons(w2,l2),
        l2:endcons(-w2,l2)


);









load(draw);
draw2d(
    
    terminal  = 'screen,
	
    title= " ",
    key = "LC0={z:abs(z)=ER}",
    xlabel     = "re ",
    ylabel     = "im",
    points_joined = true,
    point_type    = dot,
    point_size    = 5,
    color         = black,
    points(map(realpart, l0),map(imagpart, l0)),
    points_joined = false,
    color         = red,
    key = "LC1=f^(-1)(LC0)",
    points(map(realpart, l1),map(imagpart, l1)),
    
    color         = blue,
    key = "LC2=f^(-2)(LC0)",
    points(map(realpart, l2),map(imagpart, l2))
	
 );

== code end ==