From 003e9e628b3e7b516d3d70d78b6ba97bca69c813 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 27 Aug 2019 19:19:59 +0200 Subject: Brightness level according to step before excusion The test to check if something is in the set return -1 else returns the number of steps, then map the step to a brightness of the pixel. --- mandelbrot.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mandelbrot.c') diff --git a/mandelbrot.c b/mandelbrot.c index c5f5148..48d893d 100644 --- a/mandelbrot.c +++ b/mandelbrot.c @@ -6,7 +6,7 @@ #define IN_CHAR '*' #define OUT_CHAR ' ' -double mandelbrot_in_set(double complex c) +int mandelbrot_in_set(double complex c) { int i; double complex z = 0; @@ -14,9 +14,9 @@ double mandelbrot_in_set(double complex c) { z = cpow(z, 2) + c; if (cabs(z) > _INFINITY) - return 0; + return i; } - return 1; + return -1; } void mandelbrot_print(void) -- cgit