CHAPTER 1
Fractal Variations
Basic Mandelbrot Set with Pseudocode
for (int i = 0; i ≤ 500; i++) { for (int j = 0; j ≤ 500; j++) { x = 0.0; y = 0.0; xs = -2.5 + (i / 100.0); ys = -2.5 + (j / 100.0); k = 0; do { k = k + 1; xnew = x*x - y*y + xs; ynew = 2.0*x*y + ys; x = xnew; y = ynew; } while ((k ≤ kmax) && (x*x + y*y ≤ 6.25)); PlotPixel(i, j, color); } }
Mandelbrot | Build: (f(x,y), g(x,y)) | Escape: h(x,y)>value | Plot |
---|---|---|---|
Basic Mandelbrot Set | (x² - y², 2.0*x*y) | x² + y² > 6.25 | Pixel |
Mandelbrot Variant #1 | (x² - y², 2.0*x*y) | x³ + y² > 6.25 | Pixel |
Mandelbrot Variant #2 | (x*y², y*x²) | x² + y² > 6.25 | Pixel |
Mandelbrot Variant #3 | (x*y², y*x²) | x² + y² > 6.25 | Point |
Basic Julia Set with Pseudocode
for (int i = 0; i ≤ 500; i++) { for (int j = 0; j ≤ 500; j++) { xs = 0.0; ys = 0.0; x = -2.5 + (i / 100.0); y = -2.5 + (j / 100.0); k = 0; do { k = k + 1; xnew = x*x - y*y + xs; ynew = 2.0*x*y + ys; x = xnew; y = ynew; } while ((k ≤ kmax) && (x*x + y*y ≤ 6.25)); PlotPixel(i, j, color); } }
Julia | Build: (f(x, y), g(x, y), (xs, ys)) | Escape: h(x, y)>value | Plot |
---|---|---|---|
Basic Julia Set (0.0, 0.0) | (x² - y², 2.0*x*y), (0.0, 0.0) | x² + y² > 6.25 | Pixel |
Basic Julia Set (0.39, 0.36) | (x² - y², 2.0*x*y), (0.39, 0.36) | x² + y² > 6.25 | Pixel |
Julia Variant #1 | (x*y², y*x²), (0.39, 0.36) | x² + y² > 6.25 | Pixel |
Julia Variant #2 | (x*y², y*x²), (0.39, 0.36) | x² + y² > 6.25 | Point |