[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 Phoenix set fractal in C#

[Draw a Phoenix set fractal in C#] [Draw a Phoenix set fractal in C#] [Draw a Phoenix set fractal in C#] [Draw a Phoenix set fractal in C#]

This example shows how to draw a Phoenix set fractal, a shape that was discovered by Shigehiro Ushiki in 1988. The fractal is generated by iterating the equation:

Zn+1 = Zn2 + Re(C) + Im(C) * Zn-1

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

Z0 = 0 Z1 = 0 C = X + Yi

The program iterates this equation until the magnitude of Zn is at least 2 or the program performs a maximum number of iterations. It then uses the number of iterations as an index into an array of colors to set the pixel's color.

This example provides a lot of other features such as the ability to zoom in and out and the ability to select the colors used. See the code for details.

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

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