Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
L-system
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Example 5: Sierpinski triangle=== The [[Sierpinski triangle]] drawn using an L-system. : '''variables''' : F G : '''constants''' : + − : '''start''' : F−G−G : '''rules''' : (F → F−G+F+G−F), (G → GG) : '''angle''' : 120° Here, F and G both mean "draw forward", + means "turn left by angle", and − means "turn right by angle". <gallery mode="nolines" widths="256px" heights="256px"> File:Sierpinski Triangle (from L-System, 2 iterations).png|n = 2 File:Sierpinski Triangle (from L-System, 4 iterations).png|n = 4 File:Sierpinski Triangle (from L-System, 6 iterations).png|n = 6 </gallery> It is also possible to approximate the [[Sierpinski triangle]] using a [[Sierpiński arrowhead curve]] L-system. : '''variables''' : A B : '''constants''' : + − : '''start''' : A : '''rules''' : (A → B−A−B), (B → A+B+A) : '''angle''' : 60° Here, A and B both mean "draw forward", + means "turn left by angle", and − means "turn right by angle" (see [[turtle graphics]]). [[File:Serpinski Lsystem.svg|centre]] {{center|1=Evolution for ''n'' = 2, ''n'' = 4, ''n'' = 6, ''n'' = 8}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)