- /
-
Multiple Dragon Curves
on 18 Oct 2021
- 6
- 25
- 1
- 0
- 237
DragonCurve([0;0],[1;0]);
hold on;
DragonCurve([0;0],[0;1]);
DragonCurve([0;0],[-1;0]);
DragonCurve([0;0],[0;-1]);
function DragonCurve(c,p)
R=[0 -1; 1 0];
for i=1:20
q=R*(p-c)+c;
p=[p c fliplr(q(:,2:end))];
c=q(:,1);
end
plot(p(1,:),p(2,:));
axis equal off;
end