aboutsummaryrefslogtreecommitdiff
path: root/algorithms/burning-ship-lattice.c
diff options
context:
space:
mode:
Diffstat (limited to 'algorithms/burning-ship-lattice.c')
-rw-r--r--algorithms/burning-ship-lattice.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/algorithms/burning-ship-lattice.c b/algorithms/burning-ship-lattice.c
index a219537..7c2d1e9 100644
--- a/algorithms/burning-ship-lattice.c
+++ b/algorithms/burning-ship-lattice.c
@@ -31,27 +31,26 @@ void *generate_burning_ship_lattice_section(void *section)
{
data_section *d = (data_section*)section;
unsigned int x,y,i;
- int idx = 0;
double a,b;
double complex z,c;
double size_units = 0.09f;
double top = -0.082f;
double left = -1.8f;
- for (y = d->core, b = (d->core*(size_units/d->size)+top); y < d->size; b+=((d->cores*size_units)/d->size), y+=d->cores)
+ for (y = d->core, b = (d->core*(size_units/size)+top); y < size; b+=((cores*size_units)/size), y+=cores)
{
- for (x = 0, a = left; x < d->size; a+=(size_units/d->size), x++)
+ for (x = 0, a = left; x < size; a+=(size_units/size), x++)
{
z = 0;
c = a+I*b;
- for (i = 0; i < d->iterat; i++)
+ for (i = 0; i < iterat; i++)
{
if (cabsf(z) >= 2)
break;
- z = cpow( cabsf(crealf(z)) + I*cabsf(cimagf(z)) , d->power) + c;
+ z = cpow( cabsf(crealf(z)) + I*cabsf(cimagf(z)) , power) + c;
}
- d->data[idx++] = (255*i)/d->iterat;
+ d->data[d->idx++] = (255*i)/iterat;
}
}
return NULL;