summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-04-05 22:59:06 +0200
committertomsmeding <tom.smeding@gmail.com>2017-04-05 22:59:06 +0200
commitf84e1814e1fe0e216eecd7bfe98a422e4144ee56 (patch)
treee63c4cc12d5784d2b90ff1a76d8602182ddf630c
parente6613ad22bf7fa6da52609136c4c7630cc2f3a4b (diff)
Render mandelbrots
-rw-r--r--attract.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/attract.c b/attract.c
index 7a31bb9..9e093ec 100644
--- a/attract.c
+++ b/attract.c
@@ -17,11 +17,12 @@
const int MAXITER=200;
const double EPS=1e-1;
-static double complex att_func(double complex x,double exponent){
- return clog((1-cpow(x,exponent+1))/(1-x));
+static double complex att_func(double complex x,double exponent,double complex start){
+ // return clog((1-cpow(x,exponent+1))/(1-x));
// return x;
- return x*x+CMPLX(-0.2,0.7);
+ // return x*x+CMPLX(-0.2,0.7);
+ return x*x+start;
// return csqrt(M_SQRT2*x); // sqrt(2) and 0
// return csqrt(1+x); // phi
@@ -100,7 +101,7 @@ static void* thread_entry(void *arg_vp){
cfg.midy-(double)(iy-cfg.height/2)/cfg.unitsz);
double complex z=start;
for(int i=0;i<MAXITER;i++){
- z=att_func(z,cfg.exponent);
+ z=att_func(z,cfg.exponent,start);
}
if(do_basins){
int bi;