16 #ifndef LINEARINTERPOLATION_H
17 #define LINEARINTERPOLATION_H
28 type temp = ((x -
x0) * y1 + (x1 - x) * y0) / (x1 - x0);
45 real u = (y - y0) / (y1 - y0);
46 if ((std::isfinite(u) == 1) && (std::isfinite(t) == 1)) {
47 temp = (1 -
t) * (1 - u) * f0 + t * (1 -
u) * f1 + t * u * f2 +
50 if (std::isfinite(u) == 0)
52 if (std::isfinite(t) == 0)
65 real u = (y - y0) / (y1 - y0);
66 real v = (z - z0) / (z1 - z0);
68 if ((std::isfinite(u) == 1) && (std::isfinite(t) == 1) &&
69 (std::isfinite(v) == 1)) {
70 temp = (1 -
t) * (1 - u) * (1 -
v) * f000;
71 temp = temp + (1 -
t) * (1 - u) * v * f001;
72 temp = temp + (1 -
t) * u * (1 - v) * f010;
73 temp = temp + (1 -
t) * u * v * f011;
74 temp = temp + t * (1 -
u) * (1 - v) * f100;
75 temp = temp + t * (1 -
u) * v * f101;
76 temp = temp + t * u * (1 -
v) * f110;
77 temp = temp + t * u * v * f111;
79 if (std::isfinite(t) == 0)
80 temp =
BilinearInt(y0, y1, z0, z1, f000, f010, f011, f001, y, z);
81 if (std::isfinite(v) == 0)
82 temp =
BilinearInt(x0, x1, y0, y1, f000, f100, f110, f010, x, y);
83 if (std::isfinite(u) == 0)
84 temp =
BilinearInt(x0, x1, z0, z1, f000, f100, f101, f001, x, z);
91 #endif // LINEARINTERPOLATION_H