[C# Helper]
Index Books FAQ Contact About Rod
[Beginning Database Design Solutions, Second Edition]

[Beginning Software Engineering, Second Edition]

[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]

[C# 5.0 Programmer's Reference]

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

Title: Draw a Pickover popcorn fractal in C#

[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 = Xn - h * Sin(Yn + Tan(3 * Yn)) Yn+1 = Yn - h * Sin(Xn + Tan(3 * Xn))

Here X0 and Y0 are the coordinates of the point you clicked. You can enter values for the constant h and the number of iterations to perform in the text boxes.

If you click the Plot All button, the program plots the series for every dx-th pixel, where dx is taken from the dx text box. For example, if dx = 10 and h = 0.01, the program plots the series for every 10th pixel vertically and horizontally giving this result:

Experiment with the values in the text boxes to see what difference they make. In my next post, I'll add some color to the program.

The details about how the program works are fairly straightforward. Download the example program and take a look for more information.

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

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