diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-08-27 19:04:34 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-08-27 19:04:34 +0200 |
| commit | ce5cf1b60dae81540b2db366b1408a961f771dcc (patch) | |
| tree | 25de8dc9727deb188f57fe01c2cf7575d5fbb4bc /header.h | |
| parent | 7c48d434f0a68ac47ebe1bd66daa2c86842979c7 (diff) | |
| download | mandelbrot-ce5cf1b60dae81540b2db366b1408a961f771dcc.tar.gz mandelbrot-ce5cf1b60dae81540b2db366b1408a961f771dcc.tar.bz2 mandelbrot-ce5cf1b60dae81540b2db366b1408a961f771dcc.zip | |
Set visualization
Loop throught each pixel and color it black if its in the set,
white otherwise.
This is eavily inspired by the coding train video on the subject.
(https://www.youtube.com/watch?v=6z7GQewK-Ks)
Diffstat (limited to 'header.h')
| -rw-r--r-- | header.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -5,6 +5,18 @@ # include <complex.h> # include <SDL2/SDL.h> +# define WINDOW_W 500 +# define WINDOW_H 500 + +# define LO -1.5 +# define HI 1.5 +# define AXIS_DIV 46.0 +# define AXIS_STEP ((HI - LO) / AXIS_DIV) + +# define MAX_ITERATION 50 +# define _INFINITY 15 + + typedef struct { SDL_Window *window; @@ -27,4 +39,7 @@ GState *graphics_init(GConf *conf); void graphics_quit(GState *state); void graphics_run(GState *state); +// helper.c +double map_range(double x, double src_lo, double src_hi, double dest_lo, double dest_hi); + #endif |
