42 void fractal(
float left,
float top,
float xside,
float yside) {
43 float xscale, yscale, zx, zy, cx, tempx, cy;
45 int maxx, maxy, count;
54 xscale = xside / maxx;
55 yscale = yside / maxy;
59 rectangle(0, 0, maxx, maxy);
64 for (y = 1; y <= maxy - 1; y++) {
65 for (x = 1; x <= maxx - 1; x++) {
67 cx = x * xscale + left;
70 cy = y * yscale + top;
85 while ((zx * zx + zy * zy < 4) && (count <
MAXCOUNT)) {
91 tempx = zx * zx - zy * zy + cx;
94 zy = 2 * zx * zy + cy;
104 putpixel(x, y, count);
116 int gd = DETECT, gm, errorcode;
118 float left, top, xside, yside;
139 initgraph(&gd, &gm, driver);
142 fractal(left, top, xside, yside);
void fractal(float left, float top, float xside, float yside)