+{-# INLINE zoom_lookup #-}
+zoom_lookup :: Grid -> ScaleFactor -> a -> (R.DIM3 -> Double)
+zoom_lookup g scale_factor _ = zoom_result g scale_factor
+
+
+{-# INLINE zoom_result #-}
+zoom_result :: Grid -> ScaleFactor -> R.DIM3 -> Double
+zoom_result g (sfx, sfy, sfz) (R.Z R.:. i R.:. j R.:. k) =
+ f p
+ where
+ i' = (fromIntegral i) / (fromIntegral sfx)
+ j' = (fromIntegral j) / (fromIntegral sfy)
+ k' = (fromIntegral k) / (fromIntegral sfz)
+ p = (i', j', k') :: Point
+ c = find_containing_cube g p
+ t = find_containing_tetrahedron c p
+ f = polynomial t
+
+
+zoom :: Grid -> ScaleFactor -> Values3D