Fractal
Class LSystem2FDBoxCounting
java.lang.Object
Fractal.LSystem2Renderer
Fractal.LSystem2FDBoxCounting
- All Implemented Interfaces:
- FractalDimension
public class LSystem2FDBoxCounting
- extends LSystem2Renderer
- implements FractalDimension
Extended LSystem renderer with box-counting fractal dimension calculating
- Author:
- eliott bartley
Constructor Summary |
LSystem2FDBoxCounting(java.lang.String axiom,
java.lang.String grammar,
int depth,
float angle,
int size)
|
Method Summary |
double |
calcFractalDimension()
Approximate the fractal dimension using box-counting. |
protected void |
drawLine(java.lang.Object user,
int x,
int y,
int u,
int v)
|
void |
setBoxSize(int size)
Change the box-size. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LSystem2FDBoxCounting
public LSystem2FDBoxCounting(java.lang.String axiom,
java.lang.String grammar,
int depth,
float angle,
int size)
setBoxSize
public void setBoxSize(int size)
- Change the box-size. The area of the fractal will be divided evenly by
the squared box-size value - i.e. 2 will divide the fractal into 4
squares, 2 across, 2 down - 4 will divide into 16 squares, 4 across, 4
down
calcFractalDimension
public double calcFractalDimension()
- Approximate the fractal dimension using box-counting. This is done by
rendering the fractal unto an image of dimensions specified by the box-
size, and counting the pixels rendered
- Specified by:
calcFractalDimension
in interface FractalDimension
drawLine
protected void drawLine(java.lang.Object user,
int x,
int y,
int u,
int v)
- Specified by:
drawLine
in class LSystem2Renderer