function I = milieu(A,B)
    I = [(A(1)+B(1))/2,(A(2)+B(2))/2]
endfunction

function B =pointsuivant (A)
    de = floor(3*rand()+1);
    if de == 1 do 
        B = milieu(A, [0,0])
    elseif de == 2 do
        B = milieu(A, [2,0])
    else
       B = milieu(A, [1,sqrt(3)/2])
    end
endfunction
