diff options
| author | JP Appel <jeanpierre.appel01@gmail.com> | 2024-04-24 19:45:29 -0400 |
|---|---|---|
| committer | JP Appel <jeanpierre.appel01@gmail.com> | 2024-04-24 19:45:29 -0400 |
| commit | 59cfd01f60c9b5dd7f1a61da80e05dff587792f3 (patch) | |
| tree | 1225f3dcf087b57fc38547456d7d80c1226a21dd /src/fractals.c | |
| parent | b23fe21501d41d4de75dde9968f0a785f81c083b (diff) | |
created struct to support cuda
Diffstat (limited to 'src/fractals.c')
| -rw-r--r-- | src/fractals.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/fractals.c b/src/fractals.c index 269bfaf..556cdb1 100644 --- a/src/fractals.c +++ b/src/fractals.c @@ -83,7 +83,7 @@ int main(const int argc, char *argv[]) { sscanf(optarg, CFORMAT"+"CFORMAT"i", &re_upper_right, &im_upper_right); break; case 'o': - //TODO: check if within length + //TODO: check if can write to location //TODO: break; case 'p': @@ -108,8 +108,10 @@ int main(const int argc, char *argv[]) { } } - const CBASE complex lower_left = re_lower_left + im_lower_left * I; - const CBASE complex upper_right = re_upper_right + im_upper_right * I; + //const CBASE complex lower_left = re_lower_left + im_lower_left * I; + const complex_t lower_left = { .re=re_lower_left, .im=im_lower_left}; + //const CBASE complex upper_right = re_upper_right + im_upper_right * I; + const complex_t upper_right = { .re=re_upper_right, .im=im_upper_right}; grid_t* grid = create_grid(x_res, y_res, lower_left, upper_right); if(!grid) return 1; @@ -122,11 +124,16 @@ int main(const int argc, char *argv[]) { // params for different fractals const double degree = 3.0; - const CBASE complex constant = 0.285L + 0.01L*I; + // const CBASE complex constant = 0.285L + 0.01L*I; + const complex_t constant = { + .re = 0.285, + .im = 0.01 + }; // const CBASE complex constant = -0.835L -0.321L* I; const double radius = 100; - enum fractal f = BURNING_SHIP; + // enum fractal f = BURNING_SHIP; + enum fractal f = JULIA; switch(f){ case MANDELBROT: mandelbrot_grid(grid, iterations); @@ -147,7 +154,6 @@ int main(const int argc, char *argv[]) { julia_grid(grid, iterations, constant, radius); break; default: - //TODO: update fractal type fprintf(stderr, "Unrecognized fractal\n"); return 1; } |
