function p = obtem_pontos_irregulares(N,CD,LD)
rng(0,'twister') 
p = randn(N,2);
S0 = 2.0;
A0 = 0.1;
S1 = 1.5;
A1 = 4.0;
Diam = min(LD(1),LD(2))*0.98;
fprintf(2,'gerando pontos nao uniformes');
fprintf(2,' %d total\n',N);

for i = 1:N
    x = p(i,1);
    y = p(i,2);
    if mod(i,2) == 0
        rp = sqrt(x^2+y^2+S0^2+A0*(x+y)^2);
    else
        rp = sqrt(x^2+y^2+S1^2+A1*(x+y)^2);
    end
    for j =1:2
        p(i,j) = p(i,j)/rp;
        p(i,j) = CD(j) + Diam*max([-.5 min([.5,0.5*p(i,j)])]);
    end
    assert(abs(p(i,1) - CD(1))<= LD(1)/2 );
    assert(abs(p(i,2) - CD(2))<= LD(2)/2 );
end
