L-systems: Difference between revisions

From JSXGraph Wiki
No edit summary
Line 56: Line 56:
         this.next = function() {
         this.next = function() {
             if (this.pos>=this.code.length) return null;
             if (this.pos>=this.code.length) return null;
             return this.code[this.pos++];
             return this.code.charAt(this.pos++);
         }
         }
     });
     });
Line 69: Line 69:
             this.code = this.rules[pattern];
             this.code = this.rules[pattern];
         }
         }
         return this.code[this.pos++];
         return this.code.charAt(this.pos++);
     }
     }
}
}

Revision as of 13:52, 31 December 2008

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. 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



Quadratic snowflake variation


Dragon curve


Islands and lakes



Peano curve


Hexagonal Gosper curve


Plant 1


Plant 2


Hexagonal kolam


Mango kolam



Penrose tiling


References