This shows the generation of fractals using complex numbers.
Fractals are defined by an Initiator (one or more lines) and a Generator (many lines). Each line in the Initiator is replaced by the lines in the Generator, which can then be replaced. This continues until the set maximum replacements is reached.
Each line has a length and is at an angle, and when replaced by one in the Generator, its length is the product of the lengths of both lines, its angle is the sum of the angles of both lines.
This happens when two complex numbers are multiplied, so both Initiators and Generators are defined by complex numbers. The complex numbers define line's end relative to its start, so a line is drawn from the current position to that plus the new line, which becomes the new position.
The user can select the Fractal type and use the More/Fewer options to set the level of replacement before lines are drawn.
The Basic, Koch, Snowflake, Forest and Hex fractals are generated in this way. Dragon and Sierpinski Triangle require the replacement angle to be negated alternately - the conjugate of the generator number being used. For the dragon, this starts with the second, whereas for the triangle, each level toggles whether the first or second line's angle is negated. Flowsnake is a bit different as sometimes the generator is reversed.
The Sierpinski, Hilbert, Moore and Peano space filling curves also have with polar complex numbers lines between points.
You can opt to view the first few complex numbers of lines drawn (in polar form) or their end positions (in Cartesian form).
See On Complex Numbers for relevant concepts.
Simple Basic Koch SnowFlake Forest Hex
Special Dragon Sierpinski Triangle Flowsnake
Space Filling Sierpinski Hilbert Moore Peano
Replace: Show 4 Separate
View: Show 4 Superimposed
List: None Lines Positions Bounding Box