#include <GL/glut.h>
#include <graphics.h>
#include <stdio.h>
Go to the source code of this file.
|
void | fractal (float left, float top, float xside, float yside) |
|
int | main () |
|
◆ MAXCOUNT
◆ fractal()
void fractal |
( |
float |
left, |
|
|
float |
top, |
|
|
float |
xside, |
|
|
float |
yside |
|
) |
| |
Definition at line 42 of file Mandelbrot.cpp.
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);
References MAXCOUNT.
Referenced by main().
◆ main()
Definition at line 110 of file Mandelbrot.cpp.
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)
References fractal().