10 const float gx = (x -
ox()) /
dx();
11 const float gy = (y -
oy()) /
dx();
12 const float gz = (z -
oz()) /
dx();
14 if (gx < 0 || gx >=
nx() - 1 || gy < 0 || gy >=
ny() - 1 || gz < 0 || gz >=
nz() - 1) {
18 const int i0 =
static_cast<int>(gx);
19 const int j0 =
static_cast<int>(gy);
20 const int k0 =
static_cast<int>(gz);
21 const float tx = gx - i0, ty = gy - j0, tz = gz - k0;
23 auto v = [&](
int di,
int dj,
int dk) {
24 return static_cast<float>((*this)(i0 + di, j0 + dj, k0 + dk));
27 * (((1 - ty) * (((1 - tx) * v(0, 0, 0)) + (tx * v(1, 0, 0))))
28 + (ty * (((1 - tx) * v(0, 1, 0)) + (tx * v(1, 1, 0))))))
30 * (((1 - ty) * (((1 - tx) * v(0, 0, 1)) + (tx * v(1, 0, 1))))
31 + (ty * (((1 - tx) * v(0, 1, 1)) + (tx * v(1, 1, 1))))));
41 : x(nx, ny, nz, dx, ox, oy, oz),
42 y(nx, ny, nz, dx, ox, oy, oz),
43 z(nx, ny, nz, dx, ox, oy, oz) {