- /
-
Fractal tree
on 16 Oct 2021
- 1
- 22
- 0
- 0
- 240
T(0,0,10,90);
axis equal off
function T(x,y,l,a)
if l<1
return
end
x=[x x+l*cosd(a)];
y=[y y+l*sind(a)];
C=[1,0.97,0.86]*(l-1)/9+[0 1 0]*(10-l)/9;
plot(x,y,'color',C,'linewidth',3);
hold on
x=x(end);
y=y(end);
n=l/1.25;
m=l/1.2;
b=a+20;
c=a-25;
T(x,y,n,b);
T(x,y,m,c);
end