Skip to content

Filippo2903/Koch-Graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Koch Graph

A program that represents the Koch curve and Koch snowflake.

To download the latest release, click here.

Examples

Curve with 5 Iterations

Koch curve

Snowflake with 6 Iterations

Koch snowflake

How to Use It

After running the program, a window will appear where you can set the points between which the graph will be plotted and specify the iteration count.

Set coords window

You can choose between the Koch curve or the Koch snowflake using the drop-down menu.

Set graph window

Once the graph is plotted, you can zoom-in or zoom-out using the mouse wheel. You can also modify the iteration count of the fractal using the Up Arrow and Down Arrow keys. (When using the arrow keys, the maximum iteration count is limited to 5 due to performance limitations in handling a large number of lines).

How It Works

The program divides the given segment into three parts and replaces the central segment with an equilateral triangle. This operation is then repeated for all newly created segments based on the number of iterations set by the user.

To generate the snowflake, the program first creates an equilateral triangle before applying the Koch curve transformation.

Known Issues

When the iteration count is too high, the program may become slow and jerky due to the graphics library's performance limitations.