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) --- mandelbrot.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'mandelbrot.c') diff --git a/mandelbrot.c b/mandelbrot.c index 053ce70..c5f5148 100644 --- a/mandelbrot.c +++ b/mandelbrot.c @@ -1,28 +1,11 @@ #include #include #include - -#define LO -1.7 -#define HI 1.7 -#define AXIS_DIV 46.0 -#define AXIS_STEP ((HI - LO) / AXIS_DIV) - -#define MAX_ITERATION 1000 -#define _INFINITY 1000 +#include "header.h" #define IN_CHAR '*' #define OUT_CHAR ' ' -/* -#define SQUARE(x) (pow((x), 2)) -#define SQUARE_CML(z) (SQUARE(creal(z)) - SQUARE(cimag(z)) + 2 * creal(z) * cimag(z) * I) - -double magnitude(double complex z) -{ - return sqrt(SQUARE(creal(z)) + SQUARE(cimag(z))); -} -*/ - double mandelbrot_in_set(double complex c) { int i; @@ -52,3 +35,9 @@ void mandelbrot_print(void) } } +/* +#define SQUARE(x) (pow((x), 2)) +#define SQUARE_CML(z) (SQUARE(creal(z)) - SQUARE(cimag(z)) + 2 * creal(z) * cimag(z) * I) + +double magnitude(double complex z) { return sqrt(SQUARE(creal(z)) + SQUARE(cimag(z))); } +*/ -- cgit