From: hackbard Date: Tue, 16 Nov 2004 17:39:25 +0000 (+0000) Subject: some changes X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa776abeed5220766087cdc49c6cb0e5e4936865;p=physik%2Fdfe.git some changes --- diff --git a/dfe.c b/dfe.c index 42e2abf..c507fa8 100644 --- a/dfe.c +++ b/dfe.c @@ -28,13 +28,13 @@ typedef struct s_gp { double pp; } t_gp; -#define RANGE 10 +#define RANGE 4 -#define X_ 500 -#define Y_ 50 +#define X_ 50 +#define Y_ 10 -#define STEPS 1000 -#define PLOT 10 +#define STEPS 100 +#define PLOT 1 int main(int argc,char **argv) { @@ -112,7 +112,7 @@ int main(int argc,char **argv) { if((dx!=0)||(dy!=0)) { x=(gp_ptr->x+X_+dx)%X_; y=gp_ptr->y+dy; - if(y>=0) { + if(y>=0&&ypp+=exp(-1.0*sqrt(x*x+y*y)/xi); @@ -134,7 +134,6 @@ int main(int argc,char **argv) { sf[0]=0; sf[1]=0; tmp=list.current; - bf=0; gp_ptr=(t_gp *)list.current->data; for(dx=-RANGE;dx<=RANGE;dx++) { for(dy=-RANGE;dy<=RANGE;dy++) { @@ -157,7 +156,7 @@ int main(int argc,char **argv) { else { /* und hier wahrscheinlich auch */ if(dy==0) lf[0]+=(-1.0*(dx/abs(dx))*(by+co)); - if(dx==0) lf[1]+=(-1.0*(dy/abs(dy))*(by+co)); + else if(dx==0) lf[1]+=(-1.0*(dy/abs(dy))*(by+co)); else{ lf[0]+=(-1.0*dx/abs(dy)*(by+co)); lf[1]+=(-1.0*dy/abs(dx)*(by+co)); @@ -171,7 +170,7 @@ int main(int argc,char **argv) { gp_ptr->fx=sf[0]+lf[0]+((1.0*rand()/RAND_MAX)-0.5)/rs; gp_ptr->fy=sf[1]+lf[1]+((1.0*rand()/RAND_MAX)-0.5)/rs; if(gp_ptr->status&FEST) { - gp_ptr->fy+=(bf*exp(-y/100)); + gp_ptr->fy+=(bf*exp(-y*1.0/100)); if(gp_ptr->fx>0) { gp_ptr->fx-=gp_ptr->pp; if(gp_ptr->fx<0) gp_ptr->fx=0; @@ -186,7 +185,7 @@ int main(int argc,char **argv) { } else { gp_ptr->fy+=gp_ptr->pp; - if(gp_ptr->fy>0) gp_ptr->fx=0; + if(gp_ptr->fy>0) gp_ptr->fy=0; } } if(gp_ptr->y==0) gp_ptr->fy+=by; /* wenn rand by dazu, arschloch !!1 */