public abstract class KochCurve
extends java.lang.Object
| Constructor and Description |
|---|
KochCurve() |
| Modifier and Type | Method and Description |
|---|---|
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() |
void |
recurse(double startX,
double startY,
double endX,
double endY,
int n)
The recursive algorithm for the Koch curve.
|
public double hausdorffDimension()
public void recurse(double startX,
double startY,
double endX,
double endY,
int n)
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.protected abstract void drawLine(double startX,
double startY,
double endX,
double endY)
protected abstract void eraseLine(double startX,
double startY,
double endX,
double endY)