$ Tetrahedron.fv (tetrahedron0 c)
-tetrahedrons :: Cube -> [Tetrahedron]
-tetrahedrons c =
+tetrahedra :: Cube -> [Tetrahedron]
+tetrahedra c =
[tetrahedron0 c,
tetrahedron1 c,
tetrahedron2 c,
filter contains_our_point all_tetrahedra
where
contains_our_point = flip contains_point p
- all_tetrahedra = tetrahedrons c
+ all_tetrahedra = tetrahedra c
-- Quickcheck tests.
--- | Since the grid size is necessarily positive, all tetrahedrons
+-- | Since the grid size is necessarily positive, all tetrahedra
-- (which comprise cubes of positive volume) must have positive volume
-- as well.
prop_all_volumes_positive :: Cube -> Bool
prop_all_volumes_positive cube =
null nonpositive_volumes
where
- ts = tetrahedrons cube
+ ts = tetrahedra cube
volumes = map volume ts
nonpositive_volumes = filter (<= 0) volumes
prop_v0_all_equal :: Cube -> Bool
prop_v0_all_equal cube = (v0 t0) == (v0 t1)
where
- t0 = head (tetrahedrons cube) -- Doesn't matter which two we choose.
- t1 = head $ tail (tetrahedrons cube)
+ t0 = head (tetrahedra cube) -- Doesn't matter which two we choose.
+ t1 = head $ tail (tetrahedra cube)
-- | This pretty much repeats the prop_all_volumes_positive property,