shithub: fractals

Download patch

ref: bbc82d529a5b3c46630b79bd2d60125b4692df89
parent: 2f01a3e20e819812fc873f67940bf0011f49717d
author: sirjofri <sirjofri@sirjofri.de>
date: Fri Dec 29 10:05:24 EST 2023

restricts calculation iterations

--- a/gen.c
+++ b/gen.c
@@ -117,11 +117,10 @@
 	int iter = -1;
 	
 	for (int i = 0; i < params.iterations; i++) {
-		// abort if values grow too large
-		if (t.r > 64. || t.i > 64.)
-			break;
-		if (iter < 0 && t.r >= 2. && t.i >= 2.)
+		if (t.r >= 2. || t.i >= 2.) {
 			iter = i;
+			break;
+		}
 		t = cpow2(&t);
 		t = cadd(&t, &f);
 	}