aboutsummaryrefslogtreecommitdiff
path: root/src/fractals/burningship.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fractals/burningship.c')
-rw-r--r--src/fractals/burningship.c7
1 files changed, 4 insertions, 3 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);
}