Line line = new Line( x0, y0, x4, y4 ); // line segment between (x0, y0) and (x4, y4)
The above figure is a Koch snowflake. It is a triangle of three sides. Each side is drawn with four short lines that form a line with a triangular bump in the middle.
Each of the short lines is drawn with shorter lines that form a line with a triangular bump in the middle.
Each of the shorter lines is drawn with yet shorter lines that form a line with a triangular bump in the middle.
And so on, recursively.
To form a line with a triangular bump in the middle the line must be divided into three short lines. Calculate the values of endpoints using the values in (x0, y0) and (x4, y4):
Remember that Y values increase going down.