corect error where power col 0 = 0

This commit is contained in:
quentin.perret 2022-06-02 15:07:04 +02:00
parent 8339796927
commit de00ca7d32
2 changed files with 3 additions and 2 deletions

Binary file not shown.

View file

@ -11,16 +11,17 @@ void power(int **p, double a[]){
printf("temps : %f\n",temps);*/ printf("temps : %f\n",temps);*/
//Fill array with the power of the signal for each captor //Fill array with the power of the signal for each captor
for(int i = 1; i < nCol; i++){ for(int i = 0; i < nCol-1; i++){
int j = 0; int j = 0;
a[i] = 0; a[i] = 0;
while(j < nRow-1){ while(j < nRow-1){
double aire = ( pow(p[j][i],2) + pow(p[j+1][i],2) ) / 2 * periode; double aire = ( pow(p[j][i+1],2) + pow(p[j+1][i+1],2) ) / 2 * periode;
//printf("aire [%d,%d] : %f\n",j,i,aire); //printf("aire [%d,%d] : %f\n",j,i,aire);
a[i] += aire; a[i] += aire;
j++; j++;
} }
a[i] *= temps; a[i] *= temps;
//printf("%f\n", a[i]);
} }
} }
int main(int argc , char** argv){ int main(int argc , char** argv){