From ce5cf1b60dae81540b2db366b1408a961f771dcc Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 27 Aug 2019 19:04:34 +0200 Subject: 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) --- header.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'header.h') diff --git a/header.h b/header.h index 855cff3..97e3de6 100644 --- a/header.h +++ b/header.h @@ -5,6 +5,18 @@ # include # include +# 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 -- cgit