better comments
This commit is contained in:
parent
fbfdcdb33f
commit
b12b4ff429
1 changed files with 5 additions and 1 deletions
|
@ -28,8 +28,12 @@ void drawmandelbrot(SDL_Surface *surface) {
|
||||||
bool diverges = false;
|
bool diverges = false;
|
||||||
float complex z = 0;
|
float complex z = 0;
|
||||||
int it;
|
int it;
|
||||||
for (it = 1; it < 256; it++) {
|
const int max_it = 170;
|
||||||
|
for (it = 1; it <= max_it; it++) {
|
||||||
|
/* z = z² + c */
|
||||||
z = cpowf(z, 2) + c;
|
z = cpowf(z, 2) + c;
|
||||||
|
|
||||||
|
/* If |z| ever gets greater than 2, it diverges. */
|
||||||
if (cabs(z) > 2) {
|
if (cabs(z) > 2) {
|
||||||
diverges = true;
|
diverges = true;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue