nbpoints=10000
c=0.255;r=0.75;q=0.625;phi=-%pi/8;psi=%pi/5
P=zeros(2,nbpoints)
for i = 2:nbpoints
    tirage=rand()
    if tirage <1/3 then A=[[0,0] ;[0,0.255]];V=[0.5;0];
    else if tirage <2/3 then  A=[[r*cos(phi),-r*sin(phi)] ;[r*sin(phi),r*cos(phi)]];V=[0.5-0.5*r*cos(phi);c-0.5*r*sin(phi)];
         else  A=[[q*cos(psi),r*sin(phi)] ;[q*sin(psi),r*cos(phi)]];V=[0.5-0.5*q*cos(psi);0.6*c-0.5*q*sin(psi)];
         end
     end
 P(:,i)=A*P(:,i-1)+V;
end
plot(P(1,:),P(2,:),"*g");
    
    