What's New
Q & A
Tip Jar
C# Helper...
Follow VBHelper on Twitter Follow VBHelper on Twitter
MSDN Visual Basic Community
TitleDraw a Pickover popcorn fractal in Visual Basic 6
DescriptionThis example shows how to draw a Pickover popcorn fractal in Visual Basic 6.
Keywordsfractals, algorithms, mathematics, Pickover, Pickover fractal, Pickover popcorn, popcorn fractal, example, example program, Windows Forms programming, VB 6, Visual Basic 6
CategoriesAlgorithms, Graphics, Graphics

The example Draw a Pickover popcorn fractal in Visual Basic 6 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 + Tan(3 * Xn))

This program plots each point in color. When it starts a new series of points, the program loops through the colors red, green, and blue.

To plot a point, the program looks at the pixel's color and moves its red, green, or blue component halfway between its current value and the "full on" value 255. For example, suppose the program is plotting a green series of points and finds a pixel with red, green, and blue components 128, 128, and 0. It would leave the red and blue components unchanged and update the green compomnent to be halfway between its current value 128 and 255 or (128 + 255) / 2 = 383 / 2 = 191. The result is the color with RGB components 128, 191, 0.

Over time points that are hit many times by the same color become bright. Points that are hit many times by different colors become close to white.

Experiment with the program's parameters. For example, if you set h = 0.01, iterations = 100, and dx = 10, you get the following image:

Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.