- /
-
Purple recursion tree
on 6 Oct 2022
- 84
- 320
- 2
- 6
- 274
axis off
f(0,0,[0,0,-5.76,0,6.58,0],[0,55,99,55,105,55],0,1)
function f(x,y,d,R,n,N)
if n<N
b(3)=0;
if n>3
b=[.5,.2,.6];
end
X=R.*sind(d)+x;
Y=R.*cosd(d)+y;
line(X,Y,X+n,color=b,LineWidth=norm(R)/20);
A=[0 -48 -25 43 31];
for i=2:5
r=rem(i,2);
L=.58+r*.07;
f(X(i),Y(i),d+A(i),L*R,n+1,7-r)
end
end
end