DESCRIPTION: reads in the yData and xData arrays and the value of x
to be interpolated on; performs 1D interpolation,
- i.e. y=f(x)
+ i.e. y=f(x)
----------------------------------------------------------------------
REFERENCES: syntax based on interp function in c172_aero.c
mathematics based on linear interpolation functions
- found in
- Kreyszig, Erwin. Advanced Engineering Mathematics,
- 7th ed. NY: John Wiley & Sons, 1993.
+ found in
+ Kreyszig, Erwin. Advanced Engineering Mathematics,
+ 7th ed. NY: John Wiley & Sons, 1993.
----------------------------------------------------------------------
USA or view http://www.gnu.org/copyleft/gpl.html.
**********************************************************************/
+#include <simgear/compiler.h> // MSVC: to disable C4244 d to f warning
#include "uiuc_1Dinterpolation.h"
else //x between xmax and x min
{
/*loop increases i until x is less than a known x,
- e.g. Alpha from LaRCsim less than Alpha given in
- tabulated data; once this value is found, i becomes
- the upper bound and i-1 the lower bound*/
+ e.g. Alpha from LaRCsim less than Alpha given in
+ tabulated data; once this value is found, i becomes
+ the upper bound and i-1 the lower bound*/
while (xData[i] <= x) //bracket upper bound
- {
- i++;
- }
+ {
+ i++;
+ }
x2 = xData[i]; //set upper bounds
y2 = yData[i];
x1 = xData[i-1]; //set lower bounds