]> gitweb.michael.orlitzky.com - spline3.git/blob - src/Tests/Face.hs
4a1e9b89fa50cd67692319ab17aeaae258dcaf13
[spline3.git] / src / Tests / Face.hs
1 module Tests.Face
2 where
3
4 import Control.Monad (unless)
5 import Test.HUnit
6 import Test.QuickCheck
7
8 import Comparisons
9 import Face
10 import Grid (Grid(h), make_grid)
11 import Point
12 import Tetrahedron
13
14
15 -- HUnit tests.
16
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
24
25
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
33
34
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 ],
40 [ 1, 3, 5 ],
41 [ 1, 4, 7 ] ],
42 [ [ 1, 2, 3 ],
43 [ 1, 4, 7 ],
44 [ 1, 6, 11 ] ],
45 [ [ 1, 2, 3 ],
46 [ 1, 5, 9 ],
47 [ 1, 8, 15 ]]]
48
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)
55 -- where
56 -- g = make_grid 1 trilinear
57 -- cube = cube_at g 1 1 1
58 -- t = head (tetrahedrons cube) -- Any one will do.
59
60
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)
67 -- where
68 -- g = make_grid 1 trilinear
69 -- cube = cube_at g 1 1 1
70 -- t = head (tetrahedrons cube) -- Any one will do.
71
72
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)
79 -- where
80 -- g = make_grid 1 trilinear
81 -- cube = cube_at g 1 1 1
82 -- t = head (tetrahedrons cube) -- Any one will do.
83
84
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)
91 -- where
92 -- g = make_grid 1 trilinear
93 -- cube = cube_at g 1 1 1
94 -- t = head (tetrahedrons cube) -- Any one will do.
95
96
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)
103 -- where
104 -- g = make_grid 1 trilinear
105 -- cube = cube_at g 1 1 1
106 -- t = head (tetrahedrons cube) -- Any one will do.
107
108
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)
115 -- where
116 -- g = make_grid 1 trilinear
117 -- cube = cube_at g 1 1 1
118 -- t = head (tetrahedrons cube) -- Any one will do.
119
120
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)
127 -- where
128 -- g = make_grid 1 trilinear
129 -- cube = cube_at g 1 1 1
130 -- t = head (tetrahedrons cube) -- Any one will do.
131
132
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)
139 -- where
140 -- g = make_grid 1 trilinear
141 -- cube = cube_at g 1 1 1
142 -- t = head (tetrahedrons cube) -- Any one will do.
143
144
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)
151 -- where
152 -- g = make_grid 1 trilinear
153 -- cube = cube_at g 1 1 1
154 -- t = head (tetrahedrons cube) -- Any one will do.
155
156
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)
163 -- where
164 -- g = make_grid 1 trilinear
165 -- cube = cube_at g 1 1 1
166 -- t = head (tetrahedrons cube) -- Any one will do.
167
168
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)
175 -- where
176 -- g = make_grid 1 trilinear
177 -- cube = cube_at g 1 1 1
178 -- t = head (tetrahedrons cube) -- Any one will do.
179
180
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)
187 -- where
188 -- g = make_grid 1 trilinear
189 -- cube = cube_at g 1 1 1
190 -- t = head (tetrahedrons cube) -- Any one will do.
191
192
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)
199 -- where
200 -- g = make_grid 1 trilinear
201 -- cube = cube_at g 1 1 1
202 -- t = head (tetrahedrons cube) -- Any one will do.
203
204
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)
211 -- where
212 -- g = make_grid 1 trilinear
213 -- cube = cube_at g 1 1 1
214 -- t = head (tetrahedrons cube) -- Any one will do.
215
216
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)
223 -- where
224 -- g = make_grid 1 trilinear
225 -- cube = cube_at g 1 1 1
226 -- t = head (tetrahedrons cube) -- Any one will do.
227
228
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
235 -- where
236 -- g = make_grid 1 trilinear
237 -- cube = cube_at g 1 1 1
238 -- t = head (tetrahedrons cube) -- Any one will do.
239
240
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)
247 -- where
248 -- g = make_grid 1 trilinear
249 -- cube = cube_at g 1 1 1
250 -- t = head (tetrahedrons cube) -- Any one will do.
251
252
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
259 -- where
260 -- g = make_grid 1 trilinear
261 -- cube = cube_at g 1 1 1
262 -- t = head (tetrahedrons cube) -- Any one will do.
263
264
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)
271 -- where
272 -- g = make_grid 1 trilinear
273 -- cube = cube_at g 1 1 1
274 -- t = head (tetrahedrons cube) -- Any one will do.
275
276
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
283 -- -- where
284 -- -- g = make_grid 1 trilinear
285 -- -- cube = cube_at g 1 1 1
286 -- -- t = head (tetrahedrons cube) -- Any one will do.
287
288
289
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)
293 -- -- where
294 -- -- g = make_grid 1 trilinear
295 -- -- cube = cube_at g 1 1 1
296 -- -- t = tetrahedron0 (face0 cube) -- Any one will do.
297
298
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)
302 -- -- where
303 -- -- g = make_grid 1 trilinear
304 -- -- cube = cube_at g 1 1 1
305 -- -- t = tetrahedron0 (face0 cube) -- Any one will do.
306
307
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)
311 -- -- where
312 -- -- g = make_grid 1 trilinear
313 -- -- cube = cube_at g 1 1 1
314 -- -- t = tetrahedron0 (face0 cube) -- Any one will do.
315
316
317
318 -- -- test_trilinear_f0_t0_v3 :: Test
319 -- -- test_trilinear_f0_t0_v3 =
320 -- -- TestCase $ assertClose "v3 is correct" (v3 t) (1, 1, 1)
321 -- -- where
322 -- -- g = make_grid 1 trilinear
323 -- -- cube = cube_at g 1 1 1
324 -- -- t = tetrahedron0 (face0 cube) -- Any one will do.
325
326
327
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]
353
354
355 -- -- QuickCheck Tests.
356
357
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],
365 -- j <- [0..2],
366 -- k <- [0..2],
367 -- i + j + k == 2]
368 -- where
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)
373
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
378 -- where
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)
383
384
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
389 -- where
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)
394
395
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
400 -- where
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)
405
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
410 -- where
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)
415
416
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
421 -- where
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)
426
427
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
432 -- where
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)
437
438
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
443 -- where
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)
448
449
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
454 -- where
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)
459
460
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
465 -- where
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)
470
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
475 -- where
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)
480
481
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
486 -- where
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)
491
492
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
497 -- where
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)
502
503
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)
508 -- where
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)
513
514
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)
519 -- where
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)
524
525
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)
530 -- where
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)
535
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)
540 -- where
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)
545
546
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)
551 -- where
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)
556
557
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)
562 -- where
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)
567
568
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
573 -- where
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)
578
579
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
584 -- where
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)
589
590
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
595 -- where
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)
600
601
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
606 -- where
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)
611
612
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
617 -- where
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)
622
623
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
628 -- where
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)