diff options
Diffstat (limited to 'src/fractals/mandelbrot.c')
| -rw-r--r-- | src/fractals/mandelbrot.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/fractals/mandelbrot.c b/src/fractals/mandelbrot.c index 4211cfa..5283fb5 100644 --- a/src/fractals/mandelbrot.c +++ b/src/fractals/mandelbrot.c @@ -6,7 +6,7 @@ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/24 11:07:41 by cacharle #+# #+# */ -/* Updated: 2020/02/24 13:46:22 by cacharle ### ########.fr */ +/* Updated: 2020/02/24 15:25:17 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,7 +15,7 @@ #define MANDEL_MAX_ITERATION 20 #define MANDEL_ESCAPE_RADIUS_SQUARED 100 -int mandelbrot(t_complex z) +int mandelbrot(t_state *state, t_complex z) { int n; double zr; @@ -23,6 +23,7 @@ int mandelbrot(t_complex z) double zr_square; double zi_square; + (void)state; zr = z.r; zi = z.i; n = -1; @@ -31,7 +32,7 @@ int mandelbrot(t_complex z) zi_square = zi * zi; zr_square = zr * zr; if (zr_square + zi_square > MANDEL_ESCAPE_RADIUS_SQUARED) - return (n); + break; zi = 2.0 * zr * zi; zr = zr_square - zi_square; zi += z.i; |
