diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-08-29 11:04:35 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-08-29 11:04:35 +0200 |
| commit | f85dda2684d7f75c77e3a78282dae89bc1f5a113 (patch) | |
| tree | 70a764b14a34cc7aeccb2e5bcc8b3db09e487946 /header.h | |
| parent | ec7cec7303aa642d234f444208a044dcc87904a4 (diff) | |
| download | mandelbrot-f85dda2684d7f75c77e3a78282dae89bc1f5a113.tar.gz mandelbrot-f85dda2684d7f75c77e3a78282dae89bc1f5a113.tar.bz2 mandelbrot-f85dda2684d7f75c77e3a78282dae89bc1f5a113.zip | |
Complex number optimization
Stop using the complex standard lib, replaced it with a variables
for the real part and imaginary part of z.
Diffstat (limited to 'header.h')
| -rw-r--r-- | header.h | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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); |
