From f85dda2684d7f75c77e3a78282dae89bc1f5a113 Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 29 Aug 2019 11:04:35 +0200 Subject: Complex number optimization Stop using the complex standard lib, replaced it with a variables for the real part and imaginary part of z. --- header.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'header.h') diff --git a/header.h b/header.h index cd5a988..741919e 100644 --- a/header.h +++ b/header.h @@ -10,8 +10,9 @@ # define REAL_RANGE 4.0 # define IMAG_RANGE 4.0 -# define MAX_ITERATION 20 -# define ESCAPE_VALUE 2 +# define MAX_ITERATION 35 +# define ESCAPE_RADIUS 2 +# define ESCAPE_RADIUS_SQUARED (ESCAPE_RADIUS * ESCAPE_RADIUS) typedef unsigned char Byte; typedef int ColorHexcode; @@ -49,13 +50,16 @@ typedef struct } GState; // mandelbrot.c -int mandelbrot_in_set(double _Complex c); +int mandelbrot_in_set(double a, double b); void mandelbrot_print(void); +int *mandelbrot_array(Point center, double real_range, double imag_range, + double real_len, double imag_len); // graphics.c GState *graphics_init(void); void graphics_quit(GState *state); void graphics_run(GState *state); +Color *create_palette(Color start, Color end); // helper.c double map_range(double x, double src_lo, double src_hi, double dest_lo, double dest_hi); -- cgit