corect error where power col 0 = 0
This commit is contained in:
parent
8339796927
commit
de00ca7d32
BIN
Code-C/power
BIN
Code-C/power
Binary file not shown.
|
@ -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){
|
||||||
|
|
Loading…
Reference in a new issue