diff options
author | David Phillips <dbphillipsnz@gmail.com> | 2016-06-01 13:45:28 +1200 |
---|---|---|
committer | David Phillips <dbphillipsnz@gmail.com> | 2016-06-01 13:45:28 +1200 |
commit | da9941939798abe41caa07830a5605f0d131a2f2 (patch) | |
tree | ba7d8e12f379d3d632ed02477dc747de58b0bac4 /algorithms/mandelbrot.c | |
parent | f2371dcb179928b8b36587d822daeb919b7d2d84 (diff) | |
download | fractal-gen-da9941939798abe41caa07830a5605f0d131a2f2.tar.xz |
Coords are now centre of image rather than top left
Diffstat (limited to 'algorithms/mandelbrot.c')
-rw-r--r-- | algorithms/mandelbrot.c | 11 |
1 files changed, 7 insertions, 4 deletions
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; |