Fractals[LSystem]
LSystemExamples
Lindenmayer System Examples
Description
Examples
Compatibility
LSystemExamples is a package that exports 12 examples of Lindenmayer Systems that are ready for use with the LSystemPlot and Iterate commands.
The 12 exported Lindenmayer Systems:
SierpinskiTriangle
Tree
KochCurve
FractalPlant
DragonCurve
GosperCurve
Box
Seaweed
Crystal
Rings
Carpet
PenroseTiling
Each example is itself a module with four exports:
IterationRules, InitialState, PlottingConstants, and InitialAngle
IterationRules defines the rules of the LSystem Iteration process.
InitialState defines the Initial String of the LSystem.
PlottingConstants defines the plotting procedures that each character represents.
InitialAngle defines the initial plotting angle of the LSystem.
These exports can be given to LSystemPlot, and Iterate directly as input (for the respective parameters).
LSystemExamples also exports three functions:
PlotExample, ViewStateAsString, ViewRulesAsStrings.
PlotExample accepts an exported LSystem example and an optional positive integer (the default value is 1) to specify how many times the iteration rule will be applied to the initial state. PlotExample returns a plot of the LSystem.
ViewStateAsString accepts an LSystem state and prints the string representing the state.
ViewRulesAsStrings accepts a table of LSystem rules and prints the rules as a list(string=string).
with⁡Fractals:-LSystem:
with⁡LSystemExamples:
LSKoch≔KochCurve
ViewStateAsString⁡LSKoch:-InitialState
F
ViewRulesAsStrings⁡LSKoch:-IterationRules
F=F+F-F-F+F
PlotExample⁡LSKoch
PlotExample⁡LSKoch,6
LSGosperCurve≔GosperCurve
ViewStateAsString⁡LSGosperCurve:-InitialState
X
ViewRulesAsStrings⁡LSGosperCurve:-IterationRules
Y=+X-YY--Y-X++X+Y,X=X-Y--Y+X++XX+Y-
PlotExample⁡LSGosperCurve
PlotExample⁡LSGosperCurve,5
The Fractals:-LSystem:-LSystemExamples package was introduced in Maple 2015.
For more information on Maple 2015 changes, see Updates in Maple 2015.
See Also
Iterate
LSystemPlot
Download Help Document