• Remix
  • Share
  • New Entry

on 7 Oct 2021
  • 12
  • 19
  • 0
  • 0
  • 272
% Figure and axes
figure('color','b');
axes('Color','b');
hold on
% Parameters
p=20;
k=(1+sqrt(5))/2;
a=linspace(0,pi/2,p);
% Initial position
X=0;
Y=0;
for n=1:20
% Previous position
X0=X(end);
Y0=Y(end);
% Updated angles
a=a+pi/2;
% Updated positions
X=-k^n*sin(a);
Y=+k^n*cos(a);
X=X+X0-X(1);
Y=Y+Y0-Y(1);
% Plots
plot(X,Y,'y','LineWidth',1.5);
plot(X([1 p p 1 1]),Y([1 1 p p 1]),'y:','LineWidth',1);
end
axis equal off
Remix Tree