aboutsummaryrefslogtreecommitdiff
path: root/algorithms
diff options
context:
space:
mode:
authorDavid Phillips <dbphillipsnz@gmail.com>2016-09-20 00:35:39 +1200
committerDavid Phillips <dbphillipsnz@gmail.com>2016-09-20 00:35:39 +1200
commit39949b4c290a41c70dfc2af87e6a5adc26016d7c (patch)
tree28bab55ce0ccade6d2aabff7730e39c9eb30f93a /algorithms
parent9aa24c73fe6a1978d69865d06e337c85af06b527 (diff)
parent5ed1f38b2f515c6cebd8386de44c13a2b120c878 (diff)
downloadfractal-gen-39949b4c290a41c70dfc2af87e6a5adc26016d7c.tar.xz
Merge branch 'master' into pospos
Diffstat (limited to 'algorithms')
-rw-r--r--algorithms/burning-ship.c12
-rw-r--r--algorithms/mandelbrot.c11
2 files changed, 15 insertions, 8 deletions
diff --git a/algorithms/burning-ship.c b/algorithms/burning-ship.c
index 7e27e4b..6f8c9d9 100644
--- a/algorithms/burning-ship.c
+++ b/algorithms/burning-ship.c
@@ -34,17 +34,21 @@ void
struct frame *f = &(d->parent_frame);
unsigned int x,y,i;
double a,b;
+ double left,top;
double complex z,c;
defaultsd(&d->parent_frame.scale, 3.5f);
- defaultsd(&d->parent_frame.top, -2.2f);
- defaultsd(&d->parent_frame.left, -2.2f);
+ defaultsd(&d->parent_frame.x, -0.45f);
+ defaultsd(&d->parent_frame.y, -0.45f);
+
+ left = d->parent_frame.x - (d->parent_frame.scale / 2);
+ top = d->parent_frame.y - (d->parent_frame.scale / 2);
/* FIXME document this */
- b = clust_id*(f->scale/size)+f->top; /* FIXME document this */
+ b = clust_id*(f->scale/size)+top; /* FIXME document this */
for (y = clust_id; y < size; y += clust_total) {
- a = d->core*(f->scale/size)+f->left;
+ a = d->core*(f->scale/size)+left;
for (x = d->core; x < size; x += cores) {
z = 0;
c = a+I*b;
diff --git a/algorithms/mandelbrot.c b/algorithms/mandelbrot.c
index 51d0c43..33d7cde 100644
--- a/algorithms/mandelbrot.c
+++ b/algorithms/mandelbrot.c
@@ -34,18 +34,21 @@ void
struct frame *f = &(d->parent_frame);
unsigned int x,y,i;
double a,b;
+ double left, top;
double complex z,c;
- defaultsd(&d->parent_frame.top, -1.75f);
- defaultsd(&d->parent_frame.left, -2.5f);
defaultsd(&d->parent_frame.scale, 3.5f);
+ defaultsd(&d->parent_frame.x, -0.75f);
+ defaultsd(&d->parent_frame.y, 0);
+ left = d->parent_frame.x - (d->parent_frame.scale / 2);
+ top = d->parent_frame.y - (d->parent_frame.scale / 2);
/* FIXME document this */
- b = clust_id*(f->scale/size)+f->top; /* FIXME document this */
+ b = clust_id*(f->scale/size)+top; /* FIXME document this */
for (y = clust_id; y < size; y += clust_total) {
- a = d->core*(f->scale/size)+f->left;
+ a = d->core*(f->scale/size)+left;
for (x = d->core; x < size; x += cores) {
z = 0;
c = a + I*b;