-- Don't use a cube on the boundary if we can help it. This
-- returns cube #1 if we would have returned cube #0 and cube #1
-- exists.
-- Don't use a cube on the boundary if we can help it. This
-- returns cube #1 if we would have returned cube #0 and cube #1
-- exists.
| otherwise = (ceiling ( (coord + offset) / cube_width )) - 1
where
(xsize, ysize, zsize) = dims (function_values g)
| otherwise = (ceiling ( (coord + offset) / cube_width )) - 1
where
(xsize, ysize, zsize) = dims (function_values g)
- i' = (fromIntegral i) / (fromIntegral sfx)
- j' = (fromIntegral j) / (fromIntegral sfy)
- k' = (fromIntegral k) / (fromIntegral sfz)
+ offset = (h g)/2
+ i' = (fromIntegral i) / (fromIntegral sfx) - offset
+ j' = (fromIntegral j) / (fromIntegral sfy) - offset
+ k' = (fromIntegral k) / (fromIntegral sfz) - offset
p = (i', j', k') :: Point
c = find_containing_cube g p
t = find_containing_tetrahedron c p
p = (i', j', k') :: Point
c = find_containing_cube g p
t = find_containing_tetrahedron c p