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]
330 -- face_tests = [test_trilinear_c0030,
331 -- test_trilinear_c0003,
332 -- test_trilinear_c0021,
333 -- test_trilinear_c0012,
334 -- test_trilinear_c0120,
335 -- test_trilinear_c0102,
336 -- test_trilinear_c0111,
337 -- test_trilinear_c0210,
338 -- test_trilinear_c0201,
339 -- test_trilinear_c0300,
340 -- test_trilinear_c1020,
341 -- test_trilinear_c1002,
342 -- test_trilinear_c1011,
343 -- test_trilinear_c1110,
344 -- test_trilinear_c1101,
345 -- test_trilinear_c1200,
346 -- test_trilinear_c2010,
347 -- test_trilinear_c2001,
348 -- test_trilinear_c2100,
349 -- test_trilinear_c3000,
350 -- test_trilinear_f0_t0_v0,
351 -- test_trilinear_f0_t0_v1,
352 -- test_trilinear_f0_t0_v2,
353 -- test_trilinear_f0_t0_v3]
356 -- -- QuickCheck Tests.
359 -- -- | Given in Sorokina and Zeilfelder, p. 78.
360 -- prop_cijk1_identity :: Cube -> Bool
361 -- prop_cijk1_identity cube =
362 -- and [ c t0' i j k 1 ~= (c t1' (i+1) j k 0) * ((b0 t0') (v3 t1')) +
363 -- (c t1' i (j+1) k 0) * ((b1 t0') (v3 t1')) +
364 -- (c t1' i j (k+1) 0) * ((b2 t0') (v3 t1')) +
365 -- (c t1' i j k 1) * ((b3 t0') (v3 t1')) | i <- [0..2],
370 -- t0 = tetrahedron0 (face0 cube)
371 -- t1 = tetrahedron1 (face0 cube)
372 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
373 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
375 -- -- | Given in Sorokina and Zeilfelder, p. 79.
376 -- prop_c0120_identity1 :: Cube -> Bool
377 -- prop_c0120_identity1 cube =
378 -- c t0' 0 1 2 0 ~= (c t0' 0 0 2 1 + c t1' 0 0 2 1) / 2
380 -- t0 = tetrahedron0 (face0 cube)
381 -- t1 = tetrahedron1 (face0 cube)
382 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
383 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
386 -- -- | Given in Sorokina and Zeilfelder, p. 79.
387 -- prop_c0210_identity1 :: Cube -> Bool
388 -- prop_c0210_identity1 cube =
389 -- c t0' 0 2 1 0 ~= (c t0' 0 1 1 1 + c t1' 0 1 1 1) / 2
391 -- t0 = tetrahedron0 (face0 cube)
392 -- t1 = tetrahedron1 (face0 cube)
393 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
394 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
397 -- -- | Given in Sorokina and Zeilfelder, p. 79.
398 -- prop_c0300_identity1 :: Cube -> Bool
399 -- prop_c0300_identity1 cube =
400 -- c t0' 0 3 0 0 ~= (c t0' 0 2 0 1 + c t1' 0 2 0 1) / 2
402 -- t0 = tetrahedron0 (face0 cube)
403 -- t1 = tetrahedron1 (face0 cube)
404 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
405 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
407 -- -- | Given in Sorokina and Zeilfelder, p. 79.
408 -- prop_c1110_identity :: Cube -> Bool
409 -- prop_c1110_identity cube =
410 -- c t0' 1 1 1 0 ~= (c t0' 1 0 1 1 + c t1' 1 0 1 1) / 2
412 -- t0 = tetrahedron0 (face0 cube)
413 -- t1 = tetrahedron1 (face0 cube)
414 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
415 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
418 -- -- | Given in Sorokina and Zeilfelder, p. 79.
419 -- prop_c1200_identity1 :: Cube -> Bool
420 -- prop_c1200_identity1 cube =
421 -- c t0' 1 2 0 0 ~= (c t0' 1 1 0 1 + c t1' 1 1 0 1) / 2
423 -- t0 = tetrahedron0 (face0 cube)
424 -- t1 = tetrahedron1 (face0 cube)
425 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
426 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
429 -- -- | Given in Sorokina and Zeilfelder, p. 79.
430 -- prop_c2100_identity1 :: Cube -> Bool
431 -- prop_c2100_identity1 cube =
432 -- c t0' 2 1 0 0 ~= (c t0' 2 0 0 1 + c t1' 2 0 0 1) / 2
434 -- t0 = tetrahedron0 (face0 cube)
435 -- t1 = tetrahedron1 (face0 cube)
436 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
437 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
440 -- -- | Given in Sorokina and Zeilfelder, p. 79.
441 -- prop_c0102_identity1 :: Cube -> Bool
442 -- prop_c0102_identity1 cube =
443 -- c t0' 0 1 0 2 ~= (c t0' 0 0 1 2 + c t3' 0 0 1 2) / 2
445 -- t0 = tetrahedron0 (face0 cube)
446 -- t3 = tetrahedron3 (face0 cube)
447 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
448 -- t3' = Tetrahedron cube (v3 t3) (v2 t3) (v1 t3) (v0 t3)
451 -- -- | Given in Sorokina and Zeilfelder, p. 79.
452 -- prop_c0201_identity1 :: Cube -> Bool
453 -- prop_c0201_identity1 cube =
454 -- c t0' 0 2 0 1 ~= (c t0' 0 1 1 1 + c t3' 0 1 1 1) / 2
456 -- t0 = tetrahedron0 (face0 cube)
457 -- t3 = tetrahedron3 (face0 cube)
458 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
459 -- t3' = Tetrahedron cube (v3 t3) (v2 t3) (v1 t3) (v0 t3)
462 -- -- | Given in Sorokina and Zeilfelder, p. 79.
463 -- prop_c0300_identity2 :: Cube -> Bool
464 -- prop_c0300_identity2 cube =
465 -- c t0' 3 0 0 0 ~= (c t0' 0 2 1 0 + c t3' 0 2 1 0) / 2
467 -- t0 = tetrahedron0 (face0 cube)
468 -- t3 = tetrahedron3 (face0 cube)
469 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
470 -- t3' = Tetrahedron cube (v3 t3) (v2 t3) (v1 t3) (v0 t3)
472 -- -- | Given in Sorokina and Zeilfelder, p. 79.
473 -- prop_c1101_identity :: Cube -> Bool
474 -- prop_c1101_identity cube =
475 -- c t0' 1 1 0 1 ~= (c t0' 1 1 0 1 + c t3' 1 1 0 1) / 2
477 -- t0 = tetrahedron0 (face0 cube)
478 -- t3 = tetrahedron3 (face0 cube)
479 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
480 -- t3' = Tetrahedron cube (v3 t3) (v2 t3) (v1 t3) (v0 t3)
483 -- -- | Given in Sorokina and Zeilfelder, p. 79.
484 -- prop_c1200_identity2 :: Cube -> Bool
485 -- prop_c1200_identity2 cube =
486 -- c t0' 1 1 1 0 ~= (c t0' 1 1 1 0 + c t3' 1 1 1 0) / 2
488 -- t0 = tetrahedron0 (face0 cube)
489 -- t3 = tetrahedron3 (face0 cube)
490 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
491 -- t3' = Tetrahedron cube (v3 t3) (v2 t3) (v1 t3) (v0 t3)
494 -- -- | Given in Sorokina and Zeilfelder, p. 79.
495 -- prop_c2100_identity2 :: Cube -> Bool
496 -- prop_c2100_identity2 cube =
497 -- c t0' 2 1 0 0 ~= (c t0' 2 0 1 0 + c t3' 2 0 1 0) / 2
499 -- t0 = tetrahedron0 (face0 cube)
500 -- t3 = tetrahedron3 (face0 cube)
501 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
502 -- t3' = Tetrahedron cube (v3 t3) (v2 t3) (v1 t3) (v0 t3)
505 -- -- | Given in Sorokina and Zeilfelder, p. 79.
506 -- prop_c3000_identity :: Cube -> Bool
507 -- prop_c3000_identity cube =
508 -- 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)
510 -- t0 = tetrahedron0 (face0 cube)
511 -- t2 = tetrahedron2 (face5 cube)
512 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
513 -- t2' = Tetrahedron cube (v3 t2) (v2 t2) (v1 t2) (v0 t2)
516 -- -- | Given in Sorokina and Zeilfelder, p. 79.
517 -- prop_c2010_identity :: Cube -> Bool
518 -- prop_c2010_identity cube =
519 -- 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)
521 -- t0 = tetrahedron0 (face0 cube)
522 -- t2 = tetrahedron2 (face5 cube)
523 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
524 -- t2' = Tetrahedron cube (v3 t2) (v2 t2) (v1 t2) (v0 t2)
527 -- -- | Given in Sorokina and Zeilfelder, p. 79.
528 -- prop_c2001_identity :: Cube -> Bool
529 -- prop_c2001_identity cube =
530 -- 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)
532 -- t0 = tetrahedron0 (face0 cube)
533 -- t2 = tetrahedron2 (face5 cube)
534 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
535 -- t2' = Tetrahedron cube (v3 t2) (v2 t2) (v1 t2) (v0 t2)
537 -- -- | Given in Sorokina and Zeilfelder, p. 79.
538 -- prop_c1020_identity :: Cube -> Bool
539 -- prop_c1020_identity cube =
540 -- 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)
542 -- t0 = tetrahedron0 (face0 cube)
543 -- t2 = tetrahedron2 (face5 cube)
544 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
545 -- t2' = Tetrahedron cube (v3 t2) (v2 t2) (v1 t2) (v0 t2)
548 -- -- | Given in Sorokina and Zeilfelder, p. 79.
549 -- prop_c1002_identity :: Cube -> Bool
550 -- prop_c1002_identity cube =
551 -- 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)
553 -- t0 = tetrahedron0 (face0 cube)
554 -- t2 = tetrahedron2 (face5 cube)
555 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
556 -- t2' = Tetrahedron cube (v3 t2) (v2 t2) (v1 t2) (v0 t2)
559 -- -- | Given in Sorokina and Zeilfelder, p. 79.
560 -- prop_c1011_identity :: Cube -> Bool
561 -- prop_c1011_identity cube =
562 -- 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)
564 -- t0 = tetrahedron0 (face0 cube)
565 -- t2 = tetrahedron2 (face5 cube)
566 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
567 -- t2' = Tetrahedron cube (v3 t2) (v2 t2) (v1 t2) (v0 t2)
570 -- -- | Given in Sorokina and Zeilfelder, p. 80.
571 -- prop_c0120_identity2 :: Cube -> Bool
572 -- prop_c0120_identity2 cube =
573 -- c t0' 0 1 2 0 ~= (c t0' 1 0 2 0 + c t1' 1 0 2 0) / 2
575 -- t0 = tetrahedron0 (face0 cube)
576 -- t1 = tetrahedron0 (face2 (top cube))
577 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
578 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
581 -- -- | Given in Sorokina and Zeilfelder, p. 80.
582 -- prop_c0102_identity2 :: Cube -> Bool
583 -- prop_c0102_identity2 cube =
584 -- c t0' 0 1 0 2 ~= (c t0' 1 0 0 2 + c t1' 1 0 0 2) / 2
586 -- t0 = tetrahedron0 (face0 cube)
587 -- t1 = tetrahedron0 (face2 (top cube))
588 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
589 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
592 -- -- | Given in Sorokina and Zeilfelder, p. 80.
593 -- prop_c0111_identity :: Cube -> Bool
594 -- prop_c0111_identity cube =
595 -- c t0' 0 1 1 1 ~= (c t0' 1 0 1 1 + c t1' 1 0 1 1) / 2
597 -- t0 = tetrahedron0 (face0 cube)
598 -- t1 = tetrahedron0 (face2 (top cube))
599 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
600 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
603 -- -- | Given in Sorokina and Zeilfelder, p. 80.
604 -- prop_c0210_identity2 :: Cube -> Bool
605 -- prop_c0210_identity2 cube =
606 -- c t0 0 2 1 0 ~= (c t0 1 1 1 0 + c t1 1 1 1 0) / 2
608 -- t0 = tetrahedron0 (face0 cube)
609 -- t1 = tetrahedron0 (face2 (top cube))
610 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
611 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
614 -- -- | Given in Sorokina and Zeilfelder, p. 80.
615 -- prop_c0201_identity2 :: Cube -> Bool
616 -- prop_c0201_identity2 cube =
617 -- c t0 0 2 0 1 ~= (c t0 1 1 0 1 + c t1 1 1 0 1) / 2
619 -- t0 = tetrahedron0 (face0 cube)
620 -- t1 = tetrahedron0 (face2 (top cube))
621 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
622 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
625 -- -- | Given in Sorokina and Zeilfelder, p. 80.
626 -- prop_c0300_identity3 :: Cube -> Bool
627 -- prop_c0300_identity3 cube =
628 -- c t0 0 3 0 0 ~= (c t0 1 2 0 0 + c t1 1 2 0 0) / 2
630 -- t0 = tetrahedron0 (face0 cube)
631 -- t1 = tetrahedron0 (face2 (top cube))
632 -- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
633 -- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)