Class KochCurve

java.lang.Object
org.episteme.core.mathematics.analysis.chaos.KochCurve

public class KochCurve extends Object
Koch Curve (Snowflake) - a fractal curve.

The Koch curve is constructed by recursive subdivision:

  1. Start with a line segment
  2. Divide it into thirds
  3. Replace the middle third with two sides of an equilateral triangle
  4. 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 Details

    • KochCurve

      public KochCurve()
  • Method Details

    • generate

      public static List<Point2D> generate(Point2D start, Point2D end, int depth)
      Generates the Koch curve up to a given depth.
      Parameters:
      start - starting point
      end - ending point
      depth - recursion depth (0 = line segment)
      Returns:
      list of points forming the curve
    • generateSnowflake

      public static List<Point2D> generateSnowflake(Point2D center, double radius, int depth)
      Generates a Koch snowflake (3 Koch curves forming a triangle).
      Parameters:
      center - center of the snowflake
      radius - radius of the enclosing circle
      depth - 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 segment
      depth - recursion depth
      Returns:
      total length