aboutsummaryrefslogtreecommitdiff
path: root/algorithms/tricorn.c
diff options
context:
space:
mode:
authorDavid Phillips <dbphillipsnz@gmail.com>2015-07-28 13:16:42 +1200
committerDavid Phillips <dbphillipsnz@gmail.com>2015-07-28 13:16:42 +1200
commit5de1d4d587ab2a655163f52d292a3eb982886331 (patch)
treedb97adf9d9ed8a7db1b0bb84d16ea733acb275a4 /algorithms/tricorn.c
parent6287ffad1db78798eb67f0b73194ba465118bafd (diff)
downloadfractal-gen-5de1d4d587ab2a655163f52d292a3eb982886331.tar.xz
Fixing
Diffstat (limited to 'algorithms/tricorn.c')
-rw-r--r--algorithms/tricorn.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/algorithms/tricorn.c b/algorithms/tricorn.c
index 16c399e..c89420a 100644
--- a/algorithms/tricorn.c
+++ b/algorithms/tricorn.c
@@ -31,27 +31,26 @@ void *generate_tricorn_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 = 4.f;
double top = -2.f;
double left = -2.3f;
- 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(conj(z) , d->power) + c;
+ z = cpow(conj(z) , power) + c;
}
- d->data[idx++] = (255*i)/d->iterat;
+ d->data[d->idx++] = (255*i)/iterat;
}
}
return NULL;