aboutsummaryrefslogtreecommitdiff
path: root/src/fractals
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-03-04 11:09:50 +0100
committerCharles <sircharlesaze@gmail.com>2020-03-04 11:11:24 +0100
commit9bbc949c432f6a981fdac5aec4b36edd2f4dcdba (patch)
treeb5cf3c8591267d3bc1f9fca800c1a048bd5b6004 /src/fractals
parentdab9efb7b745fe884fb72017591dce95978c19c4 (diff)
downloadfractol-linux.tar.gz
fractol-linux.tar.bz2
fractol-linux.zip
Linux branch with minilibx_linux(https://framagit.org/ggenois/minilibx_linux)linux
Diffstat (limited to 'src/fractals')
-rw-r--r--src/fractals/burningship.c7
-rw-r--r--src/fractals/tricorn.c4
2 files changed, 6 insertions, 5 deletions
diff --git a/src/fractals/burningship.c b/src/fractals/burningship.c
index 07baf38..d9e1a9c 100644
--- a/src/fractals/burningship.c
+++ b/src/fractals/burningship.c
@@ -20,9 +20,10 @@ int burningship(t_state *state, t_complex c)
t_complex z;
t_complex z_square;
double tmp;
-
+
(void)state;
- z = c;
+ z.r = c.r;
+ z.i = c.i;
n = -1;
while (++n < state->iterations)
{
@@ -30,7 +31,7 @@ int burningship(t_state *state, t_complex c)
z_square.r = z.r * z.r;
if (z_square.r + z_square.i > BURNING_SHIP_ESCAPE_RADIUS_SQUARED)
break;
- tmp = z_square.r - z_square.i + z.r;
+ tmp = z_square.r - z_square.i + c.r;
z.i = fabs(2.0 * z.r * z.i + c.i);
z.r = fabs(tmp);
}
diff --git a/src/fractals/tricorn.c b/src/fractals/tricorn.c
index 2abe01b..63c003b 100644
--- a/src/fractals/tricorn.c
+++ b/src/fractals/tricorn.c
@@ -20,7 +20,7 @@ int tricorn(t_state *state, t_complex c)
t_complex z;
t_complex z_square;
double tmp;
-
+
(void)state;
z = c;
n = -1;
@@ -30,7 +30,7 @@ int tricorn(t_state *state, t_complex c)
z_square.r = z.r * z.r;
if (z_square.r + z_square.i > TRICORN_ESCAPE_RADIUS_SQUARED)
break;
- tmp = z_square.r - z_square.i + z.r;
+ tmp = z_square.r - z_square.i + c.r;
z.i = -2.0 * z.r * z.i + c.i;
z.r = tmp;
}