diff options
author | cxp2249 <moritz.pirk@tuhh.de> | 2018-01-27 02:35:54 +0100 |
---|---|---|
committer | cxp2249 <moritz.pirk@tuhh.de> | 2018-01-27 02:35:54 +0100 |
commit | f72c4f122ccd832031925974ff521955e0e9b17c (patch) | |
tree | 02766a38371000ced0e2cb109f4e6a7f5c97a61c /src/sets.c | |
parent | cbac1496b1c8023a7fdede63e9556f2de82bbafe (diff) | |
parent | c8a38bd8ad66eb0b35f08a4733fdee37a888b83c (diff) |
Merge branch 'master' of https://collaborating.tuhh.de/cev7691/mandelbrot-zoom
Diffstat (limited to 'src/sets.c')
-rw-r--r-- | src/sets.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -7,9 +7,9 @@ #include "sets.h" -u32 mandelbrot_s(long double x, long double y, u32 iterations) +u32 mandelbrot_s(d64 x, d64 y, u32 iterations) { - long double cx = x, cy = y, x2; + d64 cx = x, cy = y, x2; u32 m = 0; while(m <= iterations && (x*x)+(y*y) <= 4) { @@ -21,16 +21,16 @@ u32 mandelbrot_s(long double x, long double y, u32 iterations) return m; } -u32 mandelbrot_r(long double x, long double y, u32 iterations) +u32 mandelbrot_r(d64 x, d64 y, u32 iterations) { return _mandelbrot_r(x, y, 0.0, 0.0, 0, iterations, 4.0); } -u32 _mandelbrot_r(long double x, long double y, long double zx, long double zy, u32 n, u32 iterations, long double threshold) +u32 _mandelbrot_r(d64 x, d64 y, d64 zx, d64 zy, u32 n, u32 iterations, d64 threshold) { if ((n < iterations) && ((zx * zx + zy * zy) < threshold)) { - long double zx_new = (zx * zx - zy * zy + x); - long double zy_new = (2 * zx * zy + y); + d64 zx_new = (zx * zx - zy * zy + x); + d64 zy_new = (2 * zx * zy + y); if ((zx_new == zx) && (zy_new == zy)) { return iterations; } @@ -39,7 +39,7 @@ u32 _mandelbrot_r(long double x, long double y, long double zx, long double zy, return n; } -u32 julia(long double x, long double y, u32 iterations) +u32 julia(d64 x, d64 y, u32 iterations) { // TODO: Julia-Menge return 0; |