Demo entry 6656168

codice per calcolo periodi

   

Submitted by Lorenzo on Oct 29, 2017 at 15:35
Language: C. Code size: 430 Bytes.

for(i = 0; i < n; i++){
    if(( (loc[i]-p0)*(loc[i+1]-p0))<=0){
      if( (loc[i+1]-p0) == 0){
	i++;
      }else{
	tmp = t;
	semtmp = semperiod;
	t = i*dt - dt *( (loc[i]-p0) / ((loc[i+1]-p0)-(loc[i]-p0)));
	semperiod = t-tmp;
	if(stampa == 0){
	  if(semtmp != 0){
	    period = semperiod + semtmp;
	    fprintf(fp,"%.6lf  %.6lf \n", t, period);
	    stampa++;
	  }
	}else{
	  stampa = 0;
	}
      }
    }
  }

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).