• New Entry

Maple Leaf

Eric Ludlam on 29 Oct 2021
  • 5
  • 37
  • 0
  • 0
  • 275
% Maple Leaf
% See https://blogs.scientificamerican.com/guest-blog/how-to-draw-with-math/
% and also "leaf pile" on File Exchange
% The original algorithm is like 400 char long. It took a lot of factoring
% to crunch it down.
t=0:.01:3; % should go to pi
c=@cos;
s=@sin;
% Random long things that appear multiple times in the equastion from sci-am
C=@(f,x)c(f*t).^x;
D=@(a,b)(c(a*t).*c(b*t)).^10;
a=@(f)1+C(6,2)+D(6,f)/5;
b=C(30,12)/9; % one of the occurances was /10, but looked close enough /w 9
d=1-C(1,10).*C(3,2);
e=1-C(1,4);
f=1-s(6*t).^10;
x=(a(24)+(C(30,2)/4+b).*f).*s(2*t).*e.*d;
y=-1.05*c(2*t).*(e+D(1,3)/2).*(a(18)+(C(30,4)/4+b).*d.*f);
fill(x,y,y);
colormap autumn
axis off
Remix Tree