darts=10000
    
x0=rand(1,darts)*2-1;
y0=rand(1,darts)*2-1;
r0=sqrt(x0.^2+y0.^2);


hits=find(x0.^2+y0.^2<1);
n=length(hits);
x=x0(hits);
y=y0(hits);
r=sqrt(x.^2+y.^2);

figure(1)
plot(sort(r0))

figure(2)
plot(sort(r))

figure(3)
plot(sort(r.^2))