# Category Archives: fractals

## Draw a recursive snowflake fractal in C#

This program draws a recursive snowflake fractal by using an initiator and a generator to define the fractal’s shape. The initiator is a curve that represent the fractal’s basic shape. In this case, the initiator is the triangle shown … Continue reading

## Draw a curly tree fractal using less memory in C#

To draw trees, the example Draw a curly tree fractal in C# first builds lists holding the end points of the tree’s branches. It then finds the bounds of those points, makes a transformation to center the tree nicely, and … Continue reading

## Draw a curly tree fractal in C#

This example uses recursion to build a fractal tree. It starts by drawing the tree’s trunk. At the end of the trunk, it creates two branches. At the end of each branch, it creates two new branches A and B. … Continue reading

## Draw a colored Pickover popcorn fractal in C#

The example Draw a Pickover popcorn fractal in C# explains how to draw the basic Pickover popcorn fractal by iterating these equations: Xn+1 = Xn – h * Sin(Yn + Tan(3 * Yn)) Yn+1 = Yn – h * Sin(Xn … Continue reading

## Draw a Pickover popcorn fractal in C#

This program maps an iterated function system in its drawing area onto the region -4 <= x <= 4, -3 <= y <= 3. If you click on a point, the program iterates these equations and plots the points: Xn+1 … Continue reading

Posted in algorithms, drawing, fractals, graphics, mathematics | | 3 Comments

## Draw four interlocking Heighway dragons in C#

One of the interesting features of the Heighway dragon curve is that it can interlock with itself as shown in this picture. The four curves all start at the same point in the middle of the picture and each is … Continue reading

## Center a Heighway dragon fractal in C#

The example Draw a Heighway dragon fractal in C# explains how to draw a Heighway dragon. That example draws its curve somewhere near the center of the form but the curve isn’t really centered. To properly size and center the … Continue reading

## Draw a Heighway dragon fractal in C#

The Heighway dragon, which is also known as the Harterâ€“Heighway dragon, is a recursive curve where each level of recursion provides more detail. The base case where the level of recursion is 0 is a straight line. From any given … Continue reading

Posted in algorithms, drawing, fractals, graphics, mathematics | | 1 Comment

## Use a queue to draw a breadth-first colored binary tree in C#

The example Draw a breadth-first colored binary tree in C# shows how to use a Stack to draw a binary tree in depth-first order. The program builds a Stack representing the bottom (trunk) level of the tree. For each level, … Continue reading