]> gitweb.michael.orlitzky.com - spline3.git/blobdiff - src/Cube.hs
Add a bunch of documentation.
[spline3.git] / src / Cube.hs
index b44f0070f5c8be1982584897efdf605884846788..cfe0e6090ed20c02f6e32acfe66fcecd797dce95 100644 (file)
@@ -33,6 +33,7 @@ instance Show Cube where
               (show (i c)) ++ "," ++ (show (j c)) ++ "," ++ (show (k c))
 
 
+-- | Returns an empty 'Cube'.
 empty_cube :: Cube
 empty_cube = Cube 0 0 0 0 empty_values
 
@@ -87,7 +88,7 @@ zmax c = (2*k' + 1)*delta / 2
 
 instance ThreeDimensional Cube where
     -- | The center of Cube_ijk coincides with v_ijk at
-    --   (ih, jh, kh). See Sorokina and Zeilfelder, p. 76.
+    --   (ih, jh, kh). See Sorokina and Zeilfelder, p. 76.    
     center c = (x, y, z)
            where
              delta = h c
@@ -98,6 +99,8 @@ instance ThreeDimensional Cube where
              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 p
         | (x_coord p) < (xmin c) = False
         | (x_coord p) > (xmax c) = False