4 import Control.Monad (unless)
10 import Grid (Grid(h), make_grid)
17 -- | An HUnit assertion that wraps the almost_equals function. Stolen
18 -- from the definition of assertEqual in Test/HUnit/Base.hs.
19 assertAlmostEqual :: String -> Double -> Double -> Assertion
20 assertAlmostEqual preface expected actual =
21 unless (actual ~= expected) (assertFailure msg)
22 where msg = (if null preface then "" else preface ++ "\n") ++
23 "expected: " ++ show expected ++ "\n but got: " ++ show actual
26 -- | An HUnit assertion that wraps the is_close function. Stolen
27 -- from the definition of assertEqual in Test/HUnit/Base.hs.
28 assertClose :: String -> Point -> Point -> Assertion
29 assertClose preface expected actual =
30 unless (actual `is_close` expected) (assertFailure msg)
31 where msg = (if null preface then "" else preface ++ "\n") ++
32 "expected: " ++ show expected ++ "\n but got: " ++ show actual
35 -- | Values of the function f(x,y,z) = 1 + x + xy + xyz taken at nine
36 -- points (hi, hj, jk) with h = 1. From example one in the paper.
37 -- Used in the next bunch of tests.
38 trilinear :: [[[Double]]]
39 trilinear = [ [ [ 1, 2, 3 ],
49 -- | Check the value of c0030 for any tetrahedron belonging to the
50 -- cube centered on (1,1,1) with a grid constructed from the
51 -- trilinear values. See example one in the paper.
52 -- test_trilinear_c0030 :: Test
53 -- test_trilinear_c0030 =
54 -- TestCase $ assertAlmostEqual "c0030 is correct" (c t 0 0 3 0) (17/8)
56 -- g = make_grid 1 trilinear
57 -- cube = cube_at g 1 1 1
58 -- t = head (tetrahedrons cube) -- Any one will do.
61 -- -- | Check the value of c0003 for any tetrahedron belonging to the
62 -- -- cube centered on (1,1,1) with a grid constructed from the
63 -- -- trilinear values. See example one in the paper.
64 -- test_trilinear_c0003 :: Test
65 -- test_trilinear_c0003 =
66 -- TestCase $ assertAlmostEqual "c0003 is correct" (c t 0 0 0 3) (27/8)
68 -- g = make_grid 1 trilinear
69 -- cube = cube_at g 1 1 1
70 -- t = head (tetrahedrons cube) -- Any one will do.
73 -- -- | Check the value of c0021 for any tetrahedron belonging to the
74 -- -- cube centered on (1,1,1) with a grid constructed from the
75 -- -- trilinear values. See example one in the paper.
76 -- test_trilinear_c0021 :: Test
77 -- test_trilinear_c0021 =
78 -- TestCase $ assertAlmostEqual "c0021 is correct" (c t 0 0 2 1) (61/24)
80 -- g = make_grid 1 trilinear
81 -- cube = cube_at g 1 1 1
82 -- t = head (tetrahedrons cube) -- Any one will do.
85 -- -- | Check the value of c0012 for any tetrahedron belonging to the
86 -- -- cube centered on (1,1,1) with a grid constructed from the
87 -- -- trilinear values. See example one in the paper.
88 -- test_trilinear_c0012 :: Test
89 -- test_trilinear_c0012 =
90 -- TestCase $ assertAlmostEqual "c0012 is correct" (c t 0 0 1 2) (71/24)
92 -- g = make_grid 1 trilinear
93 -- cube = cube_at g 1 1 1
94 -- t = head (tetrahedrons cube) -- Any one will do.
97 -- -- | Check the value of c0120 for any tetrahedron belonging to the
98 -- -- cube centered on (1,1,1) with a grid constructed from the
99 -- -- trilinear values. See example one in the paper.
100 -- test_trilinear_c0120 :: Test
101 -- test_trilinear_c0120 =
102 -- TestCase $ assertAlmostEqual "c0120 is correct" (c t 0 1 2 0) (55/24)
104 -- g = make_grid 1 trilinear
105 -- cube = cube_at g 1 1 1
106 -- t = head (tetrahedrons cube) -- Any one will do.
109 -- -- | Check the value of c0102 for any tetrahedron belonging to the
110 -- -- cube centered on (1,1,1) with a grid constructed from the
111 -- -- trilinear values. See example one in the paper.
112 -- test_trilinear_c0102 :: Test
113 -- test_trilinear_c0102 =
114 -- TestCase $ assertAlmostEqual "c0102 is correct" (c t 0 1 0 2) (73/24)
116 -- g = make_grid 1 trilinear
117 -- cube = cube_at g 1 1 1
118 -- t = head (tetrahedrons cube) -- Any one will do.
121 -- -- | Check the value of c0111 for any tetrahedron belonging to the
122 -- -- cube centered on (1,1,1) with a grid constructed from the
123 -- -- trilinear values. See example one in the paper.
124 -- test_trilinear_c0111 :: Test
125 -- test_trilinear_c0111 =
126 -- TestCase $ assertAlmostEqual "c0111 is correct" (c t 0 1 1 1) (8/3)
128 -- g = make_grid 1 trilinear
129 -- cube = cube_at g 1 1 1
130 -- t = head (tetrahedrons cube) -- Any one will do.
133 -- -- | Check the value of c0210 for any tetrahedron belonging to the
134 -- -- cube centered on (1,1,1) with a grid constructed from the
135 -- -- trilinear values. See example one in the paper.
136 -- test_trilinear_c0210 :: Test
137 -- test_trilinear_c0210 =
138 -- TestCase $ assertAlmostEqual "c0210 is correct" (c t 0 2 1 0) (29/12)
140 -- g = make_grid 1 trilinear
141 -- cube = cube_at g 1 1 1
142 -- t = head (tetrahedrons cube) -- Any one will do.
145 -- -- | Check the value of c0201 for any tetrahedron belonging to the
146 -- -- cube centered on (1,1,1) with a grid constructed from the
147 -- -- trilinear values. See example one in the paper.
148 -- test_trilinear_c0201 :: Test
149 -- test_trilinear_c0201 =
150 -- TestCase $ assertAlmostEqual "c0201 is correct" (c t 0 2 0 1) (11/4)
152 -- g = make_grid 1 trilinear
153 -- cube = cube_at g 1 1 1
154 -- t = head (tetrahedrons cube) -- Any one will do.
157 -- -- | Check the value of c0300 for any tetrahedron belonging to the
158 -- -- cube centered on (1,1,1) with a grid constructed from the
159 -- -- trilinear values. See example one in the paper.
160 -- test_trilinear_c0300 :: Test
161 -- test_trilinear_c0300 =
162 -- TestCase $ assertAlmostEqual "c0300 is correct" (c t 0 3 0 0) (5/2)
164 -- g = make_grid 1 trilinear
165 -- cube = cube_at g 1 1 1
166 -- t = head (tetrahedrons cube) -- Any one will do.
169 -- -- | Check the value of c1020 for any tetrahedron belonging to the
170 -- -- cube centered on (1,1,1) with a grid constructed from the
171 -- -- trilinear values. See example one in the paper.
172 -- test_trilinear_c1020 :: Test
173 -- test_trilinear_c1020 =
174 -- TestCase $ assertAlmostEqual "c1020 is correct" (c t 1 0 2 0) (8/3)
176 -- g = make_grid 1 trilinear
177 -- cube = cube_at g 1 1 1
178 -- t = head (tetrahedrons cube) -- Any one will do.
181 -- -- | Check the value of c1002 for any tetrahedron belonging to the
182 -- -- cube centered on (1,1,1) with a grid constructed from the
183 -- -- trilinear values. See example one in the paper.
184 -- test_trilinear_c1002 :: Test
185 -- test_trilinear_c1002 =
186 -- TestCase $ assertAlmostEqual "c1002 is correct" (c t 1 0 0 2) (23/6)
188 -- g = make_grid 1 trilinear
189 -- cube = cube_at g 1 1 1
190 -- t = head (tetrahedrons cube) -- Any one will do.
193 -- -- | Check the value of c1011 for any tetrahedron belonging to the
194 -- -- cube centered on (1,1,1) with a grid constructed from the
195 -- -- trilinear values. See example one in the paper.
196 -- test_trilinear_c1011 :: Test
197 -- test_trilinear_c1011 =
198 -- TestCase $ assertAlmostEqual "c1011 is correct" (c t 1 0 1 1) (13/4)
200 -- g = make_grid 1 trilinear
201 -- cube = cube_at g 1 1 1
202 -- t = head (tetrahedrons cube) -- Any one will do.
205 -- -- | Check the value of c1110 for any tetrahedron belonging to the
206 -- -- cube centered on (1,1,1) with a grid constructed from the
207 -- -- trilinear values. See example one in the paper.
208 -- test_trilinear_c1110 :: Test
209 -- test_trilinear_c1110 =
210 -- TestCase $ assertAlmostEqual "c1110 is correct" (c t 1 1 1 0) (23/8)
212 -- g = make_grid 1 trilinear
213 -- cube = cube_at g 1 1 1
214 -- t = head (tetrahedrons cube) -- Any one will do.
217 -- -- | Check the value of c1101 for any tetrahedron belonging to the
218 -- -- cube centered on (1,1,1) with a grid constructed from the
219 -- -- trilinear values. See example one in the paper.
220 -- test_trilinear_c1101 :: Test
221 -- test_trilinear_c1101 =
222 -- TestCase $ assertAlmostEqual "c1101 is correct" (c t 1 1 0 1) (27/8)
224 -- g = make_grid 1 trilinear
225 -- cube = cube_at g 1 1 1
226 -- t = head (tetrahedrons cube) -- Any one will do.
229 -- -- | Check the value of c1200 for any tetrahedron belonging to the
230 -- -- cube centered on (1,1,1) with a grid constructed from the
231 -- -- trilinear values. See example one in the paper.
232 -- test_trilinear_c1200 :: Test
233 -- test_trilinear_c1200 =
234 -- TestCase $ assertAlmostEqual "c1200 is correct" (c t 1 2 0 0) 3
236 -- g = make_grid 1 trilinear
237 -- cube = cube_at g 1 1 1
238 -- t = head (tetrahedrons cube) -- Any one will do.
241 -- -- | Check the value of c2010 for any tetrahedron belonging to the
242 -- -- cube centered on (1,1,1) with a grid constructed from the
243 -- -- trilinear values. See example one in the paper.
244 -- test_trilinear_c2010 :: Test
245 -- test_trilinear_c2010 =
246 -- TestCase $ assertAlmostEqual "c2010 is correct" (c t 2 0 1 0) (10/3)
248 -- g = make_grid 1 trilinear
249 -- cube = cube_at g 1 1 1
250 -- t = head (tetrahedrons cube) -- Any one will do.
253 -- -- | Check the value of c2001 for any tetrahedron belonging to the
254 -- -- cube centered on (1,1,1) with a grid constructed from the
255 -- -- trilinear values. See example one in the paper.
256 -- test_trilinear_c2001 :: Test
257 -- test_trilinear_c2001 =
258 -- TestCase $ assertAlmostEqual "c2001 is correct" (c t 2 0 0 1) 4
260 -- g = make_grid 1 trilinear
261 -- cube = cube_at g 1 1 1
262 -- t = head (tetrahedrons cube) -- Any one will do.
265 -- -- | Check the value of c2100 for any tetrahedron belonging to the
266 -- -- cube centered on (1,1,1) with a grid constructed from the
267 -- -- trilinear values. See example one in the paper.
268 -- test_trilinear_c2100 :: Test
269 -- test_trilinear_c2100 =
270 -- TestCase $ assertAlmostEqual "c2100 is correct" (c t 2 1 0 0) (7/2)
272 -- g = make_grid 1 trilinear
273 -- cube = cube_at g 1 1 1
274 -- t = head (tetrahedrons cube) -- Any one will do.
277 -- -- | Check the value of c3000 for any tetrahedron belonging to the
278 -- -- cube centered on (1,1,1) with a grid constructed from the
279 -- -- trilinear values. See example one in the paper.
280 -- -- test_trilinear_c3000 :: Test
281 -- -- test_trilinear_c3000 =
282 -- -- TestCase $ assertAlmostEqual "c3000 is correct" (c t 3 0 0 0) 4
284 -- -- g = make_grid 1 trilinear
285 -- -- cube = cube_at g 1 1 1
286 -- -- t = head (tetrahedrons cube) -- Any one will do.
290 -- -- test_trilinear_f0_t0_v0 :: Test
291 -- -- test_trilinear_f0_t0_v0 =
292 -- -- TestCase $ assertClose "v0 is correct" (v0 t) (0.5, 1.5, 1.5)
294 -- -- g = make_grid 1 trilinear
295 -- -- cube = cube_at g 1 1 1
296 -- -- t = tetrahedron0 (face0 cube) -- Any one will do.
299 -- -- test_trilinear_f0_t0_v1 :: Test
300 -- -- test_trilinear_f0_t0_v1 =
301 -- -- TestCase $ assertClose "v1 is correct" (v1 t) (1.5, 1.5, 1.5)
303 -- -- g = make_grid 1 trilinear
304 -- -- cube = cube_at g 1 1 1
305 -- -- t = tetrahedron0 (face0 cube) -- Any one will do.
308 -- -- test_trilinear_f0_t0_v2 :: Test
309 -- -- test_trilinear_f0_t0_v2 =
310 -- -- TestCase $ assertClose "v2 is correct" (v2 t) (1, 1, 1.5)
312 -- -- g = make_grid 1 trilinear
313 -- -- cube = cube_at g 1 1 1
314 -- -- t = tetrahedron0 (face0 cube) -- Any one will do.
318 -- -- test_trilinear_f0_t0_v3 :: Test
319 -- -- test_trilinear_f0_t0_v3 =
320 -- -- TestCase $ assertClose "v3 is correct" (v3 t) (1, 1, 1)
322 -- -- g = make_grid 1 trilinear
323 -- -- cube = cube_at g 1 1 1
324 -- -- t = tetrahedron0 (face0 cube) -- Any one will do.
328 -- face_tests :: [Test]
329 -- face_tests = [test_trilinear_c0030,
330 -- test_trilinear_c0003,
331 -- test_trilinear_c0021,
332 -- test_trilinear_c0012,
333 -- test_trilinear_c0120,
334 -- test_trilinear_c0102,
335 -- test_trilinear_c0111,
336 -- test_trilinear_c0210,
337 -- test_trilinear_c0201,
338 -- test_trilinear_c0300,
339 -- test_trilinear_c1020,
340 -- test_trilinear_c1002,
341 -- test_trilinear_c1011,
342 -- test_trilinear_c1110,
343 -- test_trilinear_c1101,
344 -- test_trilinear_c1200,
345 -- test_trilinear_c2010,
346 -- test_trilinear_c2001,
347 -- test_trilinear_c2100,
348 -- test_trilinear_c3000,
349 -- test_trilinear_f0_t0_v0,
350 -- test_trilinear_f0_t0_v1,
351 -- test_trilinear_f0_t0_v2,
352 -- test_trilinear_f0_t0_v3]
355 -- -- QuickCheck Tests.
358 -- -- | Given in Sorokina and Zeilfelder, p. 78.
359 -- prop_cijk1_identity :: Cube -> Bool
360 -- prop_cijk1_identity cube =
361 -- and [ c t0' i j k 1 ~= (c t1' (i+1) j k 0) * ((b0 t0') (v3 t1')) +
362 -- (c t1' i (j+1) k 0) * ((b1 t0') (v3 t1')) +
363 -- (c t1' i j (k+1) 0) * ((b2 t0') (v3 t1')) +
364 -- (c t1' i j k 1) * ((b3 t0') (v3 t1')) | i <- [0..2],
369 -- t0 = tetrahedron0 (face0 cube)
370 -- t1 = tetrahedron1 (face0 cube)
371 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
372 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
374 -- -- | Given in Sorokina and Zeilfelder, p. 79.
375 -- prop_c0120_identity1 :: Cube -> Bool
376 -- prop_c0120_identity1 cube =
377 -- c t0' 0 1 2 0 ~= (c t0' 0 0 2 1 + c t1' 0 0 2 1) / 2
379 -- t0 = tetrahedron0 (face0 cube)
380 -- t1 = tetrahedron1 (face0 cube)
381 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
382 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
385 -- -- | Given in Sorokina and Zeilfelder, p. 79.
386 -- prop_c0210_identity1 :: Cube -> Bool
387 -- prop_c0210_identity1 cube =
388 -- c t0' 0 2 1 0 ~= (c t0' 0 1 1 1 + c t1' 0 1 1 1) / 2
390 -- t0 = tetrahedron0 (face0 cube)
391 -- t1 = tetrahedron1 (face0 cube)
392 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
393 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
396 -- -- | Given in Sorokina and Zeilfelder, p. 79.
397 -- prop_c0300_identity1 :: Cube -> Bool
398 -- prop_c0300_identity1 cube =
399 -- c t0' 0 3 0 0 ~= (c t0' 0 2 0 1 + c t1' 0 2 0 1) / 2
401 -- t0 = tetrahedron0 (face0 cube)
402 -- t1 = tetrahedron1 (face0 cube)
403 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
404 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
406 -- -- | Given in Sorokina and Zeilfelder, p. 79.
407 -- prop_c1110_identity :: Cube -> Bool
408 -- prop_c1110_identity cube =
409 -- c t0' 1 1 1 0 ~= (c t0' 1 0 1 1 + c t1' 1 0 1 1) / 2
411 -- t0 = tetrahedron0 (face0 cube)
412 -- t1 = tetrahedron1 (face0 cube)
413 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
414 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
417 -- -- | Given in Sorokina and Zeilfelder, p. 79.
418 -- prop_c1200_identity1 :: Cube -> Bool
419 -- prop_c1200_identity1 cube =
420 -- c t0' 1 2 0 0 ~= (c t0' 1 1 0 1 + c t1' 1 1 0 1) / 2
422 -- t0 = tetrahedron0 (face0 cube)
423 -- t1 = tetrahedron1 (face0 cube)
424 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
425 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
428 -- -- | Given in Sorokina and Zeilfelder, p. 79.
429 -- prop_c2100_identity1 :: Cube -> Bool
430 -- prop_c2100_identity1 cube =
431 -- c t0' 2 1 0 0 ~= (c t0' 2 0 0 1 + c t1' 2 0 0 1) / 2
433 -- t0 = tetrahedron0 (face0 cube)
434 -- t1 = tetrahedron1 (face0 cube)
435 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
436 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
439 -- -- | Given in Sorokina and Zeilfelder, p. 79.
440 -- prop_c0102_identity1 :: Cube -> Bool
441 -- prop_c0102_identity1 cube =
442 -- c t0' 0 1 0 2 ~= (c t0' 0 0 1 2 + c t3' 0 0 1 2) / 2
444 -- t0 = tetrahedron0 (face0 cube)
445 -- t3 = tetrahedron3 (face0 cube)
446 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
447 -- t3' = Tetrahedron cube (v3 t3) (v2 t3) (v1 t3) (v0 t3)
450 -- -- | Given in Sorokina and Zeilfelder, p. 79.
451 -- prop_c0201_identity1 :: Cube -> Bool
452 -- prop_c0201_identity1 cube =
453 -- c t0' 0 2 0 1 ~= (c t0' 0 1 1 1 + c t3' 0 1 1 1) / 2
455 -- t0 = tetrahedron0 (face0 cube)
456 -- t3 = tetrahedron3 (face0 cube)
457 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
458 -- t3' = Tetrahedron cube (v3 t3) (v2 t3) (v1 t3) (v0 t3)
461 -- -- | Given in Sorokina and Zeilfelder, p. 79.
462 -- prop_c0300_identity2 :: Cube -> Bool
463 -- prop_c0300_identity2 cube =
464 -- c t0' 3 0 0 0 ~= (c t0' 0 2 1 0 + c t3' 0 2 1 0) / 2
466 -- t0 = tetrahedron0 (face0 cube)
467 -- t3 = tetrahedron3 (face0 cube)
468 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
469 -- t3' = Tetrahedron cube (v3 t3) (v2 t3) (v1 t3) (v0 t3)
471 -- -- | Given in Sorokina and Zeilfelder, p. 79.
472 -- prop_c1101_identity :: Cube -> Bool
473 -- prop_c1101_identity cube =
474 -- c t0' 1 1 0 1 ~= (c t0' 1 1 0 1 + c t3' 1 1 0 1) / 2
476 -- t0 = tetrahedron0 (face0 cube)
477 -- t3 = tetrahedron3 (face0 cube)
478 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
479 -- t3' = Tetrahedron cube (v3 t3) (v2 t3) (v1 t3) (v0 t3)
482 -- -- | Given in Sorokina and Zeilfelder, p. 79.
483 -- prop_c1200_identity2 :: Cube -> Bool
484 -- prop_c1200_identity2 cube =
485 -- c t0' 1 1 1 0 ~= (c t0' 1 1 1 0 + c t3' 1 1 1 0) / 2
487 -- t0 = tetrahedron0 (face0 cube)
488 -- t3 = tetrahedron3 (face0 cube)
489 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
490 -- t3' = Tetrahedron cube (v3 t3) (v2 t3) (v1 t3) (v0 t3)
493 -- -- | Given in Sorokina and Zeilfelder, p. 79.
494 -- prop_c2100_identity2 :: Cube -> Bool
495 -- prop_c2100_identity2 cube =
496 -- c t0' 2 1 0 0 ~= (c t0' 2 0 1 0 + c t3' 2 0 1 0) / 2
498 -- t0 = tetrahedron0 (face0 cube)
499 -- t3 = tetrahedron3 (face0 cube)
500 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
501 -- t3' = Tetrahedron cube (v3 t3) (v2 t3) (v1 t3) (v0 t3)
504 -- -- | Given in Sorokina and Zeilfelder, p. 79.
505 -- prop_c3000_identity :: Cube -> Bool
506 -- prop_c3000_identity cube =
507 -- c t0' 3 0 0 0 ~= c t0' 2 1 0 0 + c t2' 2 1 0 0 - ((c t0' 2 0 1 0 + c t0' 2 0 0 1)/ 2)
509 -- t0 = tetrahedron0 (face0 cube)
510 -- t2 = tetrahedron2 (face5 cube)
511 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
512 -- t2' = Tetrahedron cube (v3 t2) (v2 t2) (v1 t2) (v0 t2)
515 -- -- | Given in Sorokina and Zeilfelder, p. 79.
516 -- prop_c2010_identity :: Cube -> Bool
517 -- prop_c2010_identity cube =
518 -- c t0' 2 0 1 0 ~= c t0' 1 1 1 0 + c t2' 1 1 1 0 - ((c t0' 1 0 2 0 + c t0' 1 0 1 1)/ 2)
520 -- t0 = tetrahedron0 (face0 cube)
521 -- t2 = tetrahedron2 (face5 cube)
522 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
523 -- t2' = Tetrahedron cube (v3 t2) (v2 t2) (v1 t2) (v0 t2)
526 -- -- | Given in Sorokina and Zeilfelder, p. 79.
527 -- prop_c2001_identity :: Cube -> Bool
528 -- prop_c2001_identity cube =
529 -- c t0' 2 0 0 1 ~= c t0' 1 1 0 1 + c t2' 1 1 0 1 - ((c t0' 1 0 0 2 + c t0' 1 0 1 1)/ 2)
531 -- t0 = tetrahedron0 (face0 cube)
532 -- t2 = tetrahedron2 (face5 cube)
533 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
534 -- t2' = Tetrahedron cube (v3 t2) (v2 t2) (v1 t2) (v0 t2)
536 -- -- | Given in Sorokina and Zeilfelder, p. 79.
537 -- prop_c1020_identity :: Cube -> Bool
538 -- prop_c1020_identity cube =
539 -- c t0' 1 0 2 0 ~= c t0' 0 1 2 0 + c t2' 0 1 2 0 - ((c t0' 0 0 3 0 + c t0' 0 0 2 1)/ 2)
541 -- t0 = tetrahedron0 (face0 cube)
542 -- t2 = tetrahedron2 (face5 cube)
543 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
544 -- t2' = Tetrahedron cube (v3 t2) (v2 t2) (v1 t2) (v0 t2)
547 -- -- | Given in Sorokina and Zeilfelder, p. 79.
548 -- prop_c1002_identity :: Cube -> Bool
549 -- prop_c1002_identity cube =
550 -- c t0' 1 0 0 2 ~= c t0' 0 1 0 2 + c t2' 0 1 0 2 - ((c t0' 0 0 0 3 + c t0' 0 0 1 2)/ 2)
552 -- t0 = tetrahedron0 (face0 cube)
553 -- t2 = tetrahedron2 (face5 cube)
554 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
555 -- t2' = Tetrahedron cube (v3 t2) (v2 t2) (v1 t2) (v0 t2)
558 -- -- | Given in Sorokina and Zeilfelder, p. 79.
559 -- prop_c1011_identity :: Cube -> Bool
560 -- prop_c1011_identity cube =
561 -- c t0' 1 0 1 1 ~= c t0' 0 1 1 1 + c t2' 0 1 1 1 - ((c t0' 0 0 1 2 + c t0' 0 0 2 1)/ 2)
563 -- t0 = tetrahedron0 (face0 cube)
564 -- t2 = tetrahedron2 (face5 cube)
565 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
566 -- t2' = Tetrahedron cube (v3 t2) (v2 t2) (v1 t2) (v0 t2)
569 -- -- | Given in Sorokina and Zeilfelder, p. 80.
570 -- prop_c0120_identity2 :: Cube -> Bool
571 -- prop_c0120_identity2 cube =
572 -- c t0' 0 1 2 0 ~= (c t0' 1 0 2 0 + c t1' 1 0 2 0) / 2
574 -- t0 = tetrahedron0 (face0 cube)
575 -- t1 = tetrahedron0 (face2 (top cube))
576 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
577 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
580 -- -- | Given in Sorokina and Zeilfelder, p. 80.
581 -- prop_c0102_identity2 :: Cube -> Bool
582 -- prop_c0102_identity2 cube =
583 -- c t0' 0 1 0 2 ~= (c t0' 1 0 0 2 + c t1' 1 0 0 2) / 2
585 -- t0 = tetrahedron0 (face0 cube)
586 -- t1 = tetrahedron0 (face2 (top cube))
587 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
588 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
591 -- -- | Given in Sorokina and Zeilfelder, p. 80.
592 -- prop_c0111_identity :: Cube -> Bool
593 -- prop_c0111_identity cube =
594 -- c t0' 0 1 1 1 ~= (c t0' 1 0 1 1 + c t1' 1 0 1 1) / 2
596 -- t0 = tetrahedron0 (face0 cube)
597 -- t1 = tetrahedron0 (face2 (top cube))
598 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
599 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
602 -- -- | Given in Sorokina and Zeilfelder, p. 80.
603 -- prop_c0210_identity2 :: Cube -> Bool
604 -- prop_c0210_identity2 cube =
605 -- c t0 0 2 1 0 ~= (c t0 1 1 1 0 + c t1 1 1 1 0) / 2
607 -- t0 = tetrahedron0 (face0 cube)
608 -- t1 = tetrahedron0 (face2 (top cube))
609 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
610 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
613 -- -- | Given in Sorokina and Zeilfelder, p. 80.
614 -- prop_c0201_identity2 :: Cube -> Bool
615 -- prop_c0201_identity2 cube =
616 -- c t0 0 2 0 1 ~= (c t0 1 1 0 1 + c t1 1 1 0 1) / 2
618 -- t0 = tetrahedron0 (face0 cube)
619 -- t1 = tetrahedron0 (face2 (top cube))
620 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
621 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
624 -- -- | Given in Sorokina and Zeilfelder, p. 80.
625 -- prop_c0300_identity3 :: Cube -> Bool
626 -- prop_c0300_identity3 cube =
627 -- c t0 0 3 0 0 ~= (c t0 1 2 0 0 + c t1 1 2 0 0) / 2
629 -- t0 = tetrahedron0 (face0 cube)
630 -- t1 = tetrahedron0 (face2 (top cube))
631 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
632 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)