- /
-
Fibonacci
on 26 Oct 2021
- 8
- 27
- 4
- 0
- 279
x = 0;
y = 1;
c = colormap('lines');
axis equal off
hold on
v = [1 1];
for n = 1:16
v(n+2) = v(n)+v(n+1);
a = v(n+2);
switch mod(n,4)
case 0
y = y - v(n);
x = x - a;
case 1
y = y - a;
case 2
x = x + v(n+1);
case 3
x = x - v(n);
y = y + v(n+1);
end
pos = [x y a a];
rectangle(Pos=pos,FaceC=c(n*16-8,:),EdgeC='n');
end