From 3c845bf493856da2de260f56f60d11a6c746ccef Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Wed, 5 Apr 2017 15:58:57 +0200 Subject: Make exponent variable --- attract.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/attract.c b/attract.c index 16f1703..47f4a42 100644 --- a/attract.c +++ b/attract.c @@ -15,7 +15,7 @@ const int MAXITER=200; const double EPS=1e-1; -static double complex att_func(double complex x){ +static double complex att_func(double complex x,double exponent){ #if 0 static const int N=9; @@ -27,8 +27,7 @@ static double complex att_func(double complex x){ r+=y; return clog(r); #else - static const double N=8.5; - return clog((1-cpow(x,N+1))/(1-x)); + return clog((1-cpow(x,exponent+1))/(1-x)); #endif } @@ -49,8 +48,9 @@ static struct colour make_colour(int index){ } struct config{ - const double unitsz; - const int width,height; + double unitsz; + int width,height; + double exponent; }; struct thread_info{ @@ -86,7 +86,7 @@ static void* thread_entry(void *arg_vp){ (double)(iy-cfg.height/2)/cfg.unitsz); double complex z=start; for(int i=0;i