diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-08-27 19:19:59 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-08-27 19:19:59 +0200 |
| commit | 003e9e628b3e7b516d3d70d78b6ba97bca69c813 (patch) | |
| tree | b775b5a889bee1ef32fa37713a43964fc6bd1d43 /mandelbrot.c | |
| parent | ce5cf1b60dae81540b2db366b1408a961f771dcc (diff) | |
| download | mandelbrot-003e9e628b3e7b516d3d70d78b6ba97bca69c813.tar.gz mandelbrot-003e9e628b3e7b516d3d70d78b6ba97bca69c813.tar.bz2 mandelbrot-003e9e628b3e7b516d3d70d78b6ba97bca69c813.zip | |
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.
Diffstat (limited to 'mandelbrot.c')
| -rw-r--r-- | mandelbrot.c | 6 |
1 files changed, 3 insertions, 3 deletions
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) |
