L-systems: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 114: Line 114:
</html>
</html>


Hier


===Quadratic snowflake variation===
===Quadratic snowflake variation===
Line 120: Line 119:
<html>
<html>
<form><textarea id="inputtext1" rows=3 cols=35 wrap="off" style="width:600px;">
<form><textarea id="inputtext1" rows=3 cols=35 wrap="off" style="width:600px;">
var level = 5;
var axiom = '+F';
var rules = {
    'F':'F-F+F+F-F',
    '+' : '+',
    '-' : '-'
};
var symbols = { 'F':'F',
                '+':'+',
                '-':'-',
                '[':'[',
                ']':']'
              } ;
var angle = 90;
var len = 500/Math.pow(3,level);
</textarea><br />
</textarea><br />
<input type="button" value="run" onClick="run(1)">
<input type="button" value="run" onClick="run(1)">
Line 132: Line 146:


===Dragon curve===
===Dragon curve===
<html>
<form><textarea id="inputtext1" rows=3 cols=35 wrap="off" style="width:600px;">
</textarea><br />
<input type="button" value="run" onClick="run(1)">
<input type="button" value="clear" onClick="clearturtle(1)">
</form>
<div id="box1" class="jxgbox" style="width:600px; height:600px;"></div>
<script language="JavaScript">
brd[1] = JXG.JSXGraph.initBoard('box1', {originX: 300, originY: 300, unitX: 1, unitY: 1});
turtle[1] = new JSXTurtleObj(brd[1]);
</script>
</html>


[[Category:Examples]]
[[Category:Examples]]
[[Category:Turtle Graphics]]
[[Category:Turtle Graphics]]

Revision as of 19:45, 30 December 2008

Sierpinski curve



Quadratic snowflake variation


Dragon curve