// Copyright (c) 1995, Masanao Izumo #define N 16 #define MINX -2 #define MINY -1.0 #define MAXX 0.6 #define MAXY 1.0 #define DX 0.026 #define DY 0.0199 #define NCOLOR 8 cdefs = new int[NCOLOR]; gflush(False); gbacking_store(False); blue = gcolor("blue"); white = 0; for(i = 0; i < NCOLOR; i++) { r = 127 * sin(i / real(NCOLOR) * (M_PI * 2)) + 127; g = 127 * sin(i / real(NCOLOR) * (M_PI * 2) + (M_PI * 2.0 / 3.0)) + 127; b = 127 * sin(i / real(NCOLOR) * (M_PI * 2) + (M_PI * 4.0 / 3.0)) + 127; cdefs[i] = gcolor(r, g, b); } gopen(200, 200, "white", "black"); gwindow(MINX, MINY, MAXX, MAXY); for(x = MINX; x <= MAXX; x += DX) { for(y = MINY; y <= MAXY; y += DY) { z = complex(0, 0); r = complex(x, y); t = 0; for(n = 0; n < N && z < 2; n++) { z = z * z + r; z = z * z + r; } if(n != N) { gpen(cdefs[n % NCOLOR]); gfbox(x, y, (DX+0.001), (DY+0.001)); } } } gflush(True); gpause();