Skip to content

Filippo2903/Koch-Graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Koch graph

Program that rapresent Koch curve and Koch snowflake.

Usage: py Koch_graph.py

To download the lastest release you can click here.

Examples

Curve with 5 iteration

Koch curve

Snowflake with 6 iteration

Koch snowflake

Run

$ py Koch_graph.py

How to use it

After running the program, it will appear a window where you can set the points among which the graph will be plotted and the iteretion count.

Set coords window

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

Set graph window

When the graph is plotted, the program will allow to zoom-in or zoom-out using the mouse wheel. The program will allow to modify the iteration count of the fractal using the arrow-up and the arrow-down (using the arrows, the max count possible is 5 due to the slowness of the graphics library when it has so many line).

How it works

The program divide into three parts the segment given by the user and place an equilateral triagle insted of the central segment. Than the operation is repeated for all the segments created for the number of time entered by the user.

To represent the snowflake the program creates an equilateral triangle before all the calculations.

Known issues

When the iteration count is too high the zoom will be jerky due to the slowness of the graphics library when it has so many line.