module Tests.Cube
where
-import Debug.Trace (trace)
import Test.QuickCheck
import Comparisons
volume (tetrahedron23 c) > 0
--- | Given in Sorokina and Zeilfelder, p. 79.
---prop_c0120_identity1 :: Cube -> Bool
---prop_c0120_identity1 cube =
--- c0 ~= (c1 + c2) / 2
--- where
--- c0 = trace ("c0 :" ++ (show (c t0 0 1 2 0))) (c t0 0 1 2 0)
--- c1 = trace ("c1 :" ++ (show (c t0 0 0 2 1))) (c t0 0 0 2 1)
--- c2 = trace ("c2 :" ++ (show (c t1 0 0 2 1))) (c t1 0 0 2 1)
--- t0 = tetrahedron0 cube
--- t1 = tetrahedron1 cube
+-- | Given in Sorokina and Zeilfelder, p. 79. Note that the third and
+-- fourth indices of c-t3 have been switched. This is because we
+-- store the triangles oriented such that their volume is
+-- positive. If T and T-tilde share <v0,v1,v2> and v3,v3-tilde point
+-- in opposite directions, one of them has to have negative volume!
+prop_c0120_identity1 :: Cube -> Bool
+prop_c0120_identity1 cube =
+ c t0 0 1 2 0 ~= (c t0 0 0 2 1 + c t3 0 0 1 2) / 2
+ where
+ t0 = tetrahedron0 cube
+ t3 = tetrahedron3 cube
+
+
+-- | Given in Sorokina and Zeilfelder, p. 79. Note that the third and
+-- fourth indices of c-t3 have been switched. This is because we
+-- store the triangles oriented such that their volume is
+-- positive. If T and T-tilde share <v0,v1,v2> and v3,v3-tilde point
+-- in opposite directions, one of them has to have negative volume!
+prop_c0210_identity1 :: Cube -> Bool
+prop_c0210_identity1 cube =
+ c t0 0 2 1 0 ~= (c t0 0 1 1 1 + c t3 0 1 1 1) / 2
+ where
+ t0 = tetrahedron0 cube
+ t3 = tetrahedron3 cube
+
+
+-- | Given in Sorokina and Zeilfelder, p. 79. Note that the third and
+-- fourth indices of c-t3 have been switched. This is because we
+-- store the triangles oriented such that their volume is
+-- positive. If T and T-tilde share <v0,v1,v2> and v3,v3-tilde point
+-- in opposite directions, one of them has to have negative volume!
+prop_c0300_identity1 :: Cube -> Bool
+prop_c0300_identity1 cube =
+ c t0 0 3 0 0 ~= (c t0 0 2 0 1 + c t3 0 2 1 0) / 2
+ where
+ t0 = tetrahedron0 cube
+ t3 = tetrahedron3 cube
+
+
+-- | Given in Sorokina and Zeilfelder, p. 79. Note that the third and
+-- fourth indices of c-t3 have been switched. This is because we
+-- store the triangles oriented such that their volume is
+-- positive. If T and T-tilde share <v0,v1,v2> and v3,v3-tilde point
+-- in opposite directions, one of them has to have negative volume!
+prop_c1110_identity :: Cube -> Bool
+prop_c1110_identity cube =
+ c t0 1 1 1 0 ~= (c t0 1 0 1 1 + c t3 1 0 1 1) / 2
+ where
+ t0 = tetrahedron0 cube
+ t3 = tetrahedron3 cube
+
+
+-- | Given in Sorokina and Zeilfelder, p. 79. Note that the third and
+-- fourth indices of c-t3 have been switched. This is because we
+-- store the triangles oriented such that their volume is
+-- positive. If T and T-tilde share <v0,v1,v2> and v3,v3-tilde point
+-- in opposite directions, one of them has to have negative volume!
+prop_c1200_identity1 :: Cube -> Bool
+prop_c1200_identity1 cube =
+ c t0 1 2 0 0 ~= (c t0 1 1 0 1 + c t3 1 1 1 0) / 2
+ where
+ t0 = tetrahedron0 cube
+ t3 = tetrahedron3 cube
+
+
+-- | Given in Sorokina and Zeilfelder, p. 79. Note that the third and
+-- fourth indices of c-t3 have been switched. This is because we
+-- store the triangles oriented such that their volume is
+-- positive. If T and T-tilde share <v0,v1,v2> and v3,v3-tilde point
+-- in opposite directions, one of them has to have negative volume!
+prop_c2100_identity1 :: Cube -> Bool
+prop_c2100_identity1 cube =
+ c t0 2 1 0 0 ~= (c t0 2 0 0 1 + c t3 2 0 1 0) / 2
+ where
+ t0 = tetrahedron0 cube
+ t3 = tetrahedron3 cube
+
-- | Given in Sorokina and Zeilfelder, p. 78.