]> gitweb.michael.orlitzky.com - spline3.git/blobdiff - src/Tests/Cube.hs
Re-enable all of the tests for (2.6) and make them pass by switchint the third and...
[spline3.git] / src / Tests / Cube.hs
index 26d4d33f5ab7e21f3b85fc032ae98113edd6b25d..666fde8899c168f85b061430ce06f5ee3ca93e1f 100644 (file)
@@ -1,7 +1,6 @@
 module Tests.Cube
 where
 
-import Debug.Trace (trace)
 import Test.QuickCheck
 
 import Comparisons
@@ -263,16 +262,83 @@ prop_tetrahedron23_volumes_positive c =
     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.