- k' = fromIntegral (k c) :: Double
- delta = h c
-
-instance ThreeDimensional Cube where
- -- | The center of Cube_ijk coincides with v_ijk at
- -- (ih, jh, kh). See Sorokina and Zeilfelder, p. 76.
- center c = (x, y, z)
- where
- delta = h c
- i' = fromIntegral (i c) :: Double
- j' = fromIntegral (j c) :: Double
- k' = fromIntegral (k c) :: Double
- x = delta * i'
- y = delta * j'
- z = delta * k'
-
- -- | It's easy to tell if a point is within a cube; just make sure
- -- that it falls on the proper side of each of the cube's faces.
- contains_point c (x, y, z)
- | x < (xmin c) = False
- | x > (xmax c) = False
- | y < (ymin c) = False
- | y > (ymax c) = False
- | z < (zmin c) = False
- | z > (zmax c) = False
- | otherwise = True