# The King's Dream

The King's Dream is a simple, yet beautiful fractal. The formulas to produce it were developed by Clifford Pickover, and published in his book Chaos in Wonderland. To create this fractal, two equations, representing the X and Y coordinates of the screen, must be iterated many times. The recursive definitions, or formulas, for this fractal are :

xn = sin(yn-1 * b) + c * sin(xn-1 * b)
yn = sin(xn-1 * a) + d * sin(yn-1 * a)

Both the X and Y formulas rely on A, B, C, and D as constants. These values will determine the fractal's behavior. However, only one combination will produce the first image on this page. The values used to make the King's Dream are :

 A B C D -0.966918 2.879879 0.765145 0.744728

Once these formulas, using the above constants, are repeated thousands of times, the King's Dream will be drawn. This can be done on almost any computer, and some graphing calculators, in any language. To help demonstrate one of the hallmark traits of chaos, sensitivity to initial conditions, I've made the image to the right. It was created using small deviations on the constants of the King's Dream. Each value was altered by no more than a tenth, yet the fractal is obviously different. The general form remains, but it's quite different.

The two images on this page have been created using a simple Turbo C++ program. The fractals are drawn in 1024 x 768 resolution, in 256 colors. You'll need at least 1 MB of video RAM in an IBM-compatible PC to run this. The source code and a DOS-compiled executable file are available for download.

Also, a Java applet is available that will create the King's Dream, in real time, on your computer.