org.jscience.mathematics.analysis.chaos
Class KochCurve

java.lang.Object
  extended by org.jscience.mathematics.analysis.chaos.KochCurve

public abstract class KochCurve
extends java.lang.Object

The KochCurve class provides an object that encapsulates the Koch curve.


Constructor Summary
KochCurve()
          Creates a new KochCurve object.
 
Method Summary
protected abstract  void drawLine(double startX, double startY, double endX, double endY)
          Draws a line segment in a 2D plane.
protected abstract  void eraseLine(double startX, double startY, double endX, double endY)
          Erases a line segment in a 2D plane.
 double hausdorffDimension()
          DOCUMENT ME!
 void recurse(double startX, double startY, double endX, double endY, int n)
          The recursive algorithm for the Koch curve.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KochCurve

public KochCurve()
Creates a new KochCurve object.

Method Detail

hausdorffDimension

public double hausdorffDimension()
DOCUMENT ME!

Returns:
DOCUMENT ME!

recurse

public void recurse(double startX,
                    double startY,
                    double endX,
                    double endY,
                    int n)
The recursive algorithm for the Koch curve.

Parameters:
startX - the x-coordinate of the start of the line.
startY - the x-coordinate of the start of the line.
endX - the x-coordinate of the end of the line.
endY - the x-coordinate of the end of the line.
n - the number of recursions.

drawLine

protected abstract void drawLine(double startX,
                                 double startY,
                                 double endX,
                                 double endY)
Draws a line segment in a 2D plane. This need not be an actual graphical operation, but some corresponding abstract operation.

Parameters:
startX - DOCUMENT ME!
startY - DOCUMENT ME!
endX - DOCUMENT ME!
endY - DOCUMENT ME!

eraseLine

protected abstract void eraseLine(double startX,
                                  double startY,
                                  double endX,
                                  double endY)
Erases a line segment in a 2D plane. This need not be an actual graphical operation, but some corresponding abstract operation.

Parameters:
startX - DOCUMENT ME!
startY - DOCUMENT ME!
endX - DOCUMENT ME!
endY - DOCUMENT ME!