[C# Helper]
Index Books FAQ Contact About Rod
[Essential Algorithms, Second Edition]

[The Modern C# Challenge]

[WPF 3d, Three-Dimensional Graphics with WPF and C#]

[The C# Helper Top 100]

[Interview Puzzles Dissected]

[C# 24-Hour Trainer]

[Beginning Software Engineering]

[C# 5.0 Programmer's Reference]

[MCSD Certification Toolkit (Exam 70-483): Programming in C#]

Title: Draw a vortex fractal in C#

vortex fractal

I discovered the vortex fractal while I was trying to draw the Phoenix set. (I'll show how to draw the phoenix set in a later post.)

The vortex fractal (a name I picked because some versions of the fractal look like whirling vortices) is generated by iterating the equation:

Z(n+1) = Z(n)2 + Re(C) + Im(C) × Z(n-1)

Where the Zs and C are complex numbers, C is a constant, and for a point (X, Y):

Z(0) = X + Yi
Z(1) = X + Yi

The program iterates this equation until the magnitude of Z(n) is at least 2, or until the program performs a maximum number of iterations. See the code for the details.

Experiment with the example to draw some interesting images. Use the Options menu's Set Options command to set the colors the program uses and the maximum number of iterations it will perform.

 
 
 

Download the example to experiment with it and to see additional details.

© 2009-2022 Rocky Mountain Computer Consulting, Inc. All rights reserved.