Script to solve second order (polynomial) interpolation
Currently I have awk command to do linear interpolation
Code:
awk ' Code:
#X Y Code:
1 22.3125 EXPECTED OUTPUT Code:
1 22.3125 
Quote:
Quote:

Quote:
Code:
1 22.3125 
You did not answer the question about HOW you arrived at those figures?

Quote:
(((xx2) * (xx3)) / ((x1x2) * (x1x3))) * y1 + (((xx1) * (xx3)) / ((x2x1) * (x2x3))) * y2 + (((xx1) * (xx2)) / ((x3x1) * (x3x1))) * y3 x = current ID; x1 = the first known ID (second previous known ID); > 1 x2 = the second known ID (first previous known ID); > 4 x3 = the third known ID (next known ID); > 8 y1 = the first known value (the value of ID x1) y2 = the second known value (the value of ID x2) y3 = the third known value (the value of ID x3) 
And are you saying you cannot implement the formula in awk? Seems fairly straight forward.

Again, it gives a different values than what you showed in the first post. Perhaps the last parenthesis should have been (x3x2) instead of (x3x1)?
But even then it does not explain the values 33.something. Anyway, you just described the algorithm, so you obviously know how to do it. So what exactly is preventing you from putting it into a script? 
All times are GMT 5. The time now is 04:22 AM. 