From c6f87a62b31325e91bc8c847de9b20647a9b1cd8 Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 24 Feb 2020 15:39:22 +0100 Subject: Added julia fractal and mouse modify julia constant --- src/fractals/mandelbrot.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/fractals/mandelbrot.c') 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 +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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; -- cgit