Class KochCurve
java.lang.Object
org.episteme.core.mathematics.analysis.chaos.KochCurve
Koch Curve (Snowflake) - a fractal curve.
The Koch curve is constructed by recursive subdivision:
- Start with a line segment
- Divide it into thirds
- Replace the middle third with two sides of an equilateral triangle
- Repeat for each segment
Properties
- Hausdorff dimension: log(4)/log(3) ≈ 1.2619
- Infinite length in finite area
- Continuous but nowhere differentiable
- Self-similar at all scales
References
- von Koch, Helge (1904). "Sur une courbe continue sans tangente"
- Mandelbrot, B. (1982). "The Fractal Geometry of Nature"
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doublecurveLength(double initialLength, int depth) Calculates the length of the Koch curve at a given depth.Generates the Koch curve up to a given depth.generateSnowflake(Point2D center, double radius, int depth) Generates a Koch snowflake (3 Koch curves forming a triangle).static doubleCalculates the Hausdorff dimension of the Koch curve.
-
Constructor Details
-
KochCurve
public KochCurve()
-
-
Method Details
-
generate
-
generateSnowflake
Generates a Koch snowflake (3 Koch curves forming a triangle).- Parameters:
center- center of the snowflakeradius- radius of the enclosing circledepth- recursion depth- Returns:
- list of points forming the snowflake
-
hausdorffDimension
public static double hausdorffDimension()Calculates the Hausdorff dimension of the Koch curve.- Returns:
- log(4)/log(3) ≈ 1.2619
-
curveLength
public static double curveLength(double initialLength, int depth) Calculates the length of the Koch curve at a given depth.- Parameters:
initialLength- length of the initial segmentdepth- recursion depth- Returns:
- total length
-