You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
858 B
34 lines
858 B
namespace Auto_Calibration |
|
{ |
|
public class Auto_Cali |
|
{ |
|
public static double[] AutoCali(double[] f, double[] n, double[] h, float nn) |
|
{ |
|
double[] array = new double[12]; |
|
for (int i = 0; i < 12; i++) |
|
{ |
|
//if (f[i] < n[i]) |
|
//{ |
|
// h[i] = h[i] - f[i] + n[i]; |
|
// n[i] = f[i]; |
|
//} |
|
|
|
//if (f[i] > h[i]) |
|
//{ |
|
// n[i] = n[i] + f[i] - h[i]; |
|
// h[i] = f[i]; |
|
//} |
|
|
|
if (h[i] <= n[i]) |
|
{ |
|
array[i] = 0; |
|
continue; |
|
} |
|
array[i] = (f[i] - n[i]) / (h[i] - n[i]) * (double)nn; |
|
|
|
} |
|
|
|
return array; |
|
} |
|
} |
|
} |