arbre(A,B,Rap,Ang,n):={ si n>0 alors segment(point(A),point(B)),seq(arbre(B,B+Rap[q]*exp(Ang[q]*i)*(B-A),Rap,Ang,n-1),q =0..size(Rap)-1) sinon segment(point(A),point(B)) fsi }:;
Programme 306 L-System (XCAS) sachant que
arbre(0,i,[0.7,0.8],[pi/5.,-pi/5.],7)
donne
Comment obtenir cette fougre et ce brocolis ?
E 2 Avec Sage Guillaume Connan, Licence Creative Commons , 2009-2010