﻿ VB Helper: HowTo: Draw a colored Pickover popcorn fractal in Visual Basic .NET

 Home Search   What's New Index Books Links Q & A Newsletter Banners   Feedback Tip Jar MSDN Visual Basic Community

Title Draw a colored Pickover popcorn fractal in Visual Basic .NET This example shows how to draw a colored Pickover popcorn fractal in Visual Basic .NET. fractals, algorithms, mathematics, Pickover, Pickover fractal, Pickover popcorn, popcorn fractal, example, example program, Windows Forms programming, VB.NET, Visual Basic .NET Algorithms, Graphics, Graphics

The example Draw a Pickover popcorn fractal in Visual Basic .NET 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: