L-systems: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 133: Line 133:
* [[Hexagonal kolam]]
* [[Hexagonal kolam]]
* [[Mango kolam]]
* [[Mango kolam]]
 
* [[Penrose tiling]]
<html>
<form><textarea id="inputtext9" rows=3 cols=35 wrap="off" style="width:600px;">
var level = 5;
var axiom = 'A---A';
var rules = {
    'F' : 'F',
    'f' : 'f',
    'A' : 'f-F+Z+F-fA',
    'Z' : 'F-FF-F--[--Z]F-FF-F--F-FF-F--',
    '[' : '[',
    ']' : ']',
    '+' : '+',
    '-' : '-'
};
var symbols = { 'F':'F',
                'f':'f',
                'A':' ',
                'Z':' ',
                '+':'+',
                '-':'-',
                '[':'[',
                ']':']'
              } ;
             
var angle = 60;
var len = 100/(level);
</textarea><br />
<input type="button" value="run" onClick="run(9)">
<input type="button" value="clear" onClick="clearturtle(9)">
</form>
<div id="box9" class="jxgbox" style="width:600px; height:600px;"></div>
<script language="JavaScript">
brd[9] = JXG.JSXGraph.initBoard('box9', {originX: 300, originY: 300, unitX: 1, unitY: 1});
turtle[9] = brd[9].createElement('turtle');
</script>
</html>
 
 
===Penrose tiling===


<html>
<html>

Revision as of 17:19, 2 February 2009

Online experiments with Lindenmayer Systems

A Lindenmayer System consists of

  • an initial string called axiom
  • a set of rewriting rules

This is an experimental page, where the Lindenmayer Systems can be changed online. The visualization is done by the JavaScript library JSXGraph. For each system a maximum level is defined. If this value is increased, the complexity of the drawing rises and running time increases, too.

Most of the examples are from the book by Przemyslaw Prusinkiewicz and James Hanan: Lindenmayer Systems, Fractals, and Plants, see the References.

Sierpinski curve



The underlying JavaScript code

The underlying JavaScript code for producing Lindenmayer systems

References