L-systems: Difference between revisions

From JSXGraph Wiki
No edit summary
Line 63: Line 63:
}
}


function plotter(generator,symbols,len,angle,t) {
function plotter(generator,symbols,len,angle,t,shrink) {
     for (var c; c=generator.next(); c) {
     for (var c; c=generator.next(); c) {
         switch(symbols[c]) {
         switch(symbols[c]) {
Line 94: Line 94:
     return null;
     return null;
   }
   }
 
var shrink = 1.0;
function run(nr) {
function run(nr) {
   brd[nr].suspendUpdate();
   brd[nr].suspendUpdate();
Line 104: Line 105:
   eval(code);
   eval(code);
   var generator = new expander(level,axiom,rules);
   var generator = new expander(level,axiom,rules);
   plotter(generator,symbols,len,angle,t);
   plotter(generator,symbols,len,angle,t,shrink);
   brd[nr].unsuspendUpdate();
   brd[nr].unsuspendUpdate();
}
}

Revision as of 20:04, 30 December 2008

Sierpinski curve



Quadratic snowflake variation


Dragon curve


Islands and lakes



Peano curve


Hexagonal Gosper curve


Plant 1


Plant 2



Hexagonal kolam


Mango kolam



Penrose tiling