Fractal
Class LSystem2

java.lang.Object
  extended by Fractal.LSystem2

public class LSystem2
extends java.lang.Object

LSystem algorithm. So, I seen that this algorithm appears twice in LSystem.java and twice again in largeLSystem.java, and I figured, one more. Written from scratch (rather than copy/paste), and with everything that's not LSystem related (such as GUI stuff that appears in the other four implementations) ripped out and put into callback/listeners

Author:
eliott bartley

Constructor Summary
LSystem2(java.lang.String grammar, int depth, float angle)
          Create a new LSystem and compile the grammar (recurse 'grammar', 'depth' times) with axiom of l-value of grammar or 'F'
LSystem2(java.lang.String axiom, java.lang.String grammar, int depth, float angle)
          Create a new LSystem and compile the grammar (recurse 'grammar', 'depth' times)
 
Method Summary
 float getAngle()
          Get the angle this LSystem turns by for each + - input
 java.lang.String getDerivedGrammar()
          Get the grammar expanded to the specified depth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LSystem2

public LSystem2(java.lang.String grammar,
                int depth,
                float angle)
Create a new LSystem and compile the grammar (recurse 'grammar', 'depth' times) with axiom of l-value of grammar or 'F'

Parameters:
grammar - GEVA grammar to execute
depth - Depth grammar should recurse to 'compile' it
angle - Angle LSystem turns for each turn operation, in degrees

LSystem2

public LSystem2(java.lang.String axiom,
                java.lang.String grammar,
                int depth,
                float angle)
Create a new LSystem and compile the grammar (recurse 'grammar', 'depth' times)

Parameters:
axiom - Axiom to which grammar is applied
grammar - GEVA grammar to execute
depth - Depth grammar should recurse to 'compile' it
angle - Angle LSystem turns for each turn operation, in degrees
Method Detail

getDerivedGrammar

public java.lang.String getDerivedGrammar()
Get the grammar expanded to the specified depth

Returns:
the grammar expanded to the specified depth

getAngle

public float getAngle()
Get the angle this LSystem turns by for each + - input

Returns:
the angle this LSystem turns by for each + - input