ALGORITHME de construction du pavage d'un triangle d'or par des triangles d'or
Cet algorithme est donné dans l'article de SVM
L'algorithme (récursif ) peut se traduire de la manière suivante :
Procédure penrose(P,Q,R,style,prof)
début
si prof<=1 alors tracer_le_triangle (P,Q,R)
sinon
si style =1 alors
début
déterminer S sur [PQ]
penrose(R,S,Q,1,prof-2)
penrose(S,P,R,2,prof-1)
fin
sinondébut
déterminer S sur [QR]
penrose(Q,S,P,1,prof-2)
penrose(S,R,P,2,prof-1)
finfin
var S:points;
begin
if style=1 then
begin
if prof=1 then tracer_triangle(P,Q,R)
else begin
S[1]:=P[1]*(2-phi)*Q[1]*(phi-1);
S[2]:=P[2]*(2-phi)*Q[2]*(phi-1);
penrose(R,S,Q,1,prof-2);
penrose(S,P,R,2,prof-1)end
end
else
begin
if prof=1 then tracer_triangle(P,Q,R)
else begin
S[1]:=Q[1]*(phi-1)*R[1]*(2-phi);
S[2):=Q(2]*(phi-1)*R[2]*(2-phi);
penrose(R,P,S,1,prof-1);
penrose(S,P,Q,2,prof-2)end
end
end;