X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FCube.hs;h=3f1669b619a5cbbb0ee262bd6b5f63b4c4a24355;hb=518b4b43bfd6c7c1d09841ca3ff5eeae089351ea;hp=6941425a82be541635168da6d5af85feb1a070b7;hpb=ecb77f944fcba8c8cfe60ca782bc5d9c8ab68cf9;p=spline3.git diff --git a/src/Cube.hs b/src/Cube.hs index 6941425..3f1669b 100644 --- a/src/Cube.hs +++ b/src/Cube.hs @@ -116,13 +116,13 @@ instance ThreeDimensional Cube where -- | 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 - | (y_coord p) < (ymin c) = False - | (y_coord p) > (ymax c) = False - | (z_coord p) < (zmin c) = False - | (z_coord p) > (zmax c) = False + 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 @@ -283,7 +283,7 @@ tetrahedron8 c = v1' = center (back_face c) v2' = Face.v0 (back_face c) v3' = Face.v1 (back_face c) - fv' = rotate cwy $ rotate cwy $ (Tetrahedron.fv (tetrahedron0 c)) + fv' = rotate cwy $ rotate cwy $ Tetrahedron.fv (tetrahedron0 c) tetrahedron9 :: Cube -> Tetrahedron tetrahedron9 c = @@ -462,8 +462,8 @@ tetrahedron23 c = $ Tetrahedron.fv (tetrahedron0 c) -tetrahedrons :: Cube -> [Tetrahedron] -tetrahedrons c = +tetrahedra :: Cube -> [Tetrahedron] +tetrahedra c = [tetrahedron0 c, tetrahedron1 c, tetrahedron2 c, @@ -497,4 +497,4 @@ find_containing_tetrahedra c p = filter contains_our_point all_tetrahedra where contains_our_point = flip contains_point p - all_tetrahedra = tetrahedrons c + all_tetrahedra = tetrahedra c