X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FCube.hs;h=cfe0e6090ed20c02f6e32acfe66fcecd797dce95;hb=58cf11569acb270995d2de924dda03ef526647e2;hp=b44f0070f5c8be1982584897efdf605884846788;hpb=01925d099b231a128f6bd51abd61bf9ff9c424b6;p=spline3.git diff --git a/src/Cube.hs b/src/Cube.hs index b44f007..cfe0e60 100644 --- a/src/Cube.hs +++ b/src/Cube.hs @@ -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