Filippo2903 / Koch-Graph

Koch graph plotter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Koch graph plotter


Languages

Language:C++ 59.5%Language:Python 40.5%