# Category Archives: fractals

## Draw a randomly colored Sierpinski octagon in C#

This example draws a randomly colored Sierpinski octagon. It’s basically the same as the example Draw a randomly colored Sierpinski pentagon in C# except it draws an octagon instead of a pentagon. See that example for most of the details. … Continue reading

Posted in algorithms, fractals, graphics, recursion | | Comments Off on Draw a randomly colored Sierpinski octagon in C#

## Draw a randomly colored Sierpinski pentagon in C#

The example Draw a colored Sierpinski pentagon in C# lets the user click on the parts of a Sierpinski pentagon to change their colors. Eddie Bole thought it would be interesting to color the larger pentagons in addition to the … Continue reading

Posted in drawing, fractals, graphics, recursion | | 5 Comments

## Draw a colored Sierpinski pentagon in C#

The example Draw a Sierpinski pentagon in C# shows how to draw a Sierpinski pentagon. This example modifies that one so the user can click on pentagons to change their colors. To do that, this program takes a very different … Continue reading

Posted in drawing, fractals, graphics, recursion | | 6 Comments

## Draw a Pythagoras tree fractal in C#

A Pythagoras tree (or Pythagorean tree) is a fractal tree built from squares. It starts with a square that forms the tree’s base. The program then makes the Pythagoras tree by recursively attaching two smaller branches to the original branch. … Continue reading

Posted in drawing, fractals, graphics, recursion | | 7 Comments

## Draw a Sierpinski pentagon in C#

In a Sierpinski pentagon, larger pentagons are recursively divided into five smaller pentagons with a sixth uncolored pentagon in the center. The following picture shows the first four levels of the resulting fractal. For this example, I decided to think … Continue reading

Posted in drawing, fractals, graphics, recursion | | 6 Comments

## Draw a Fibonacci word fractal in C#

This example uses the Fibonacci word to draw a fractal curve. For information on the Fibonacci word, see the post Calculate Fibonacci words in C#. To draw a curve with level N, use Fibonacci word number N. Loop through the … Continue reading

Posted in algorithms, fractals, graphics, mathematics | | Comments Off on Draw a Fibonacci word fractal in C#

## Calculate Fibonacci words in C#

You can find Fibonacci words by concatenating previous Fibonacci words much as you calculate the Fibonacci sequence by adding previous values in the sequence. The first two Fibonacci words are: S0 = 0 S1 = 01 The following Fibonacci words … Continue reading

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

## Draw the Weierstrass function in C#

The Weierstrass function was discovered by Karl Weierstrass in 1872. It’s an odd function that is continuous everywhere but differentiable nowhere. I’ll explain what that means shortly. Here’s the function: Here: The following two sections explain what it means to … Continue reading

Posted in algorithms, drawing, fractals, graphics, mathematics | | Comments Off on Draw the Weierstrass function in C#

## Draw a recursive overlapping snowflake fractal in C#

The example Draw a recursive snowflake fractal in C# explains how to use an iterator and a generator to draw a snowflake fractal. This example uses the same technique with the initiator and generator shown in the second and … Continue reading

## Draw a recursive von Koch snowflake fractal in C#

This example shows how to draw a von Koch snowflake fractal. It uses the same techniques described in the post Draw a recursive snowflake fractal in C#. The DrawSnowflake and DrawSnowflakeEdge methods are exactly the same as before. The … Continue reading

Posted in algorithms, drawing, fractals, graphics, mathematics | | Comments Off on Draw a recursive von Koch snowflake fractal in C#