forked from higham/matlab-guide-3ed
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlsys_run.m
More file actions
22 lines (18 loc) · 681 Bytes
/
lsys_run.m
File metadata and controls
22 lines (18 loc) · 681 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
%LSYS_RUN Runs lsys function to draw L-systems.
subplot(2,2,1)
rule = 'F[+F][-F][++F][--F]';
[c,d] = lsys(rule,[0;0],[0;1],[pi/8;pi/5],0.6,5);
options = {'FontSize',8,'FontWeight','normal'};
title(rule,options{:}), axis equal, axis off
subplot(2,2,2)
rule = 'F[+F]F[-F][F]';
[c,d] = lsys(rule,[0;0],[0;1],[pi/6;pi/6],1,5);
title(rule,options{:}), axis equal, axis off
subplot(2,2,3)
rule = 'F[+F][-F][++F]F[+F][-F]';
[c,d] = lsys(rule,[0;0],[0;1],[pi/5;pi/6],0.8,4);
title(rule,options{:}), axis equal, axis off
subplot(2,2,4)
rule = 'FF-[-F+F+F]+[+F-F-F]';
[c,d] = lsys(rule,[0;0],[0;1],[pi/6;pi/6],0.7,4);
title(rule,options{:}), axis equal, axis off