aboutsummaryrefslogtreecommitdiff
path: root/mandelbrot.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-08-28 08:56:31 +0200
committerCharles <sircharlesaze@gmail.com>2019-08-28 08:56:31 +0200
commit0a808a0f355390c68a5ca6f93c10758107c67700 (patch)
treeded488ba4737d0ca4d599b76046d0d726145032f /mandelbrot.c
parent003e9e628b3e7b516d3d70d78b6ba97bca69c813 (diff)
downloadmandelbrot_cpu-0a808a0f355390c68a5ca6f93c10758107c67700.tar.gz
mandelbrot_cpu-0a808a0f355390c68a5ca6f93c10758107c67700.tar.bz2
mandelbrot_cpu-0a808a0f355390c68a5ca6f93c10758107c67700.zip
State stores the window size and the domain where to look the set
Diffstat (limited to 'mandelbrot.c')
-rw-r--r--mandelbrot.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mandelbrot.c b/mandelbrot.c
index 48d893d..fcbb765 100644
--- a/mandelbrot.c
+++ b/mandelbrot.c
@@ -3,6 +3,10 @@
#include <complex.h>
#include "header.h"
+#define AXIS_DIV 46.0
+#define REAL_AXIS_STEP ((REAL_HI - REAL_LO) / AXIS_DIV)
+#define IMAG_AXIS_STEP ((IMAG_HI - IMAG_LO) / AXIS_DIV)
+
#define IN_CHAR '*'
#define OUT_CHAR ' '
@@ -21,9 +25,9 @@ int mandelbrot_in_set(double complex c)
void mandelbrot_print(void)
{
- for (double i = LO; i < HI; i += AXIS_STEP)
+ for (double i = IMAG_LO; i < IMAG_HI; i += IMAG_AXIS_STEP)
{
- for (double r = LO; r < HI; r += AXIS_STEP)
+ for (double r = REAL_LO; r < REAL_HI; r += REAL_AXIS_STEP)
{
if (mandelbrot_in_set(r + i * I))
putchar(IN_CHAR);