aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <dbphillipsnz@gmail.com>2016-03-30 00:20:38 +1300
committerDavid Phillips <dbphillipsnz@gmail.com>2016-03-30 00:20:38 +1300
commit1d50fb35485583404691d5f30420fa9d494af35f (patch)
tree27ca535829590b1099b319032b30275fd8940c44
parentb2bc9c90c39b37bf939633d44f717583413e47d9 (diff)
downloadfractal-gen-1d50fb35485583404691d5f30420fa9d494af35f.tar.xz
Style and misc updates
-rw-r--r--algorithms/burning-ship-lattice.c16
-rw-r--r--algorithms/burning-ship.c6
-rw-r--r--algorithms/mandelbrot.c4
3 files changed, 15 insertions, 11 deletions
diff --git a/algorithms/burning-ship-lattice.c b/algorithms/burning-ship-lattice.c
index 5497635..e58912e 100644
--- a/algorithms/burning-ship-lattice.c
+++ b/algorithms/burning-ship-lattice.c
@@ -25,14 +25,18 @@
* SUCH DAMAGE.
*/
-#include "../fractal-gen.h"
+#include "common.h"
void *generate_burning_ship_lattice_section(void *section)
{
data_section *d = (data_section*)section;
- unsigned int x,y,i;
- double a,b;
- double complex z,c;
+ unsigned int x = 0;
+ unsigned int y = 0;
+ unsigned int i = 0;;
+ double a = 0;
+ double b = 0;
+ double complex z = 0;
+ double complex c = 0;
double size_units = 0.09f;
double top = -0.082f;
double left = -1.8f;
@@ -49,10 +53,10 @@ void *generate_burning_ship_lattice_section(void *section)
c = a+I*b;
for (i = 0; i < iterat; i++)
{
- if (cabsf(z) >= 2)
+ if (cabs(z) >= 2)
break;
- z = cpow( cabsf(crealf(z)) + I*cabsf(cimagf(z)) , power) + c;
+ z = cpow( fabs(creal(z)) + I*fabs(cimag(z)) , power) + c;
}
d->data[d->idx++] = (255*i)/iterat;
a += (clust_total*size_units)/size;
diff --git a/algorithms/burning-ship.c b/algorithms/burning-ship.c
index c36c8c5..5c7d2e3 100644
--- a/algorithms/burning-ship.c
+++ b/algorithms/burning-ship.c
@@ -25,7 +25,7 @@
* SUCH DAMAGE.
*/
-#include "../fractal-gen.h"
+#include "common.h"
void *generate_burning_ship_section(void *section)
{
@@ -49,10 +49,10 @@ void *generate_burning_ship_section(void *section)
c = a+I*b;
for (i = 0; i < iterat; i++)
{
- if (cabsf(z) >= 2)
+ if (cabs(z) >= 2)
break;
- z = cpow( cabsf(crealf(z)) + I*cabsf(cimagf(z)) , power) + c;
+ z = cpow( fabs(creal(z)) + I*fabs(cimag(z)) , power) + c;
}
d->data[d->idx++] = (255*i)/iterat;
a += (clust_total*size_units)/size;
diff --git a/algorithms/mandelbrot.c b/algorithms/mandelbrot.c
index 8225d8c..8b59f2f 100644
--- a/algorithms/mandelbrot.c
+++ b/algorithms/mandelbrot.c
@@ -25,7 +25,7 @@
* SUCH DAMAGE.
*/
-#include "../fractal-gen.h"
+#include "common.h"
void *generate_mandelbrot_section(void *section)
{
@@ -50,7 +50,7 @@ void *generate_mandelbrot_section(void *section)
c = a + I*b;
for (i = 0; i < iterat; i++)
{
- if (cabsf(z) >= 2)
+ if (cabs(z) >= 2)
break;
z = cpow(z , power) + c;