rand('state', sum(100*clock));
ns= 2^16;
np=400;
ss = 1;
p = zeros(np,2);
for a = 1:ns
for c = 1:np
theta = rand*2*pi;
p(c,1)= p(c,1)+ss*cos(theta);
if p(c,1) > 100
p(c,1)= p(c,1)-2*ss*cos(theta);
end
if p(c,1) < -100
p(c,1)=p(c,1)-2*ss*cos(theta);
end
p(c,2)= p(c,2)+ss*sin(theta);
if p(c,2) > 100
p(c,2)= p(c,2)-2*ss*sin(theta);
end
if p(c,2) < -100
p(c,2)=p(c,2)-2*ss*sin(theta);
end
end
end
ns= 2^16;
np=400;
ss = 1;
p = zeros(np,2);
for a = 1:ns
for c = 1:np
theta = rand*2*pi;
p(c,1)= p(c,1)+ss*cos(theta);
if p(c,1) > 100
p(c,1)= p(c,1)-2*ss*cos(theta);
end
if p(c,1) < -100
p(c,1)=p(c,1)-2*ss*cos(theta);
end
p(c,2)= p(c,2)+ss*sin(theta);
if p(c,2) > 100
p(c,2)= p(c,2)-2*ss*sin(theta);
end
if p(c,2) < -100
p(c,2)=p(c,2)-2*ss*sin(theta);
end
end
end