]> gitweb.michael.orlitzky.com - spline3.git/blobdiff - src/Tests/Tetrahedron.hs
Add four tests confirming that vertex swaps don't affect coefficients.
[spline3.git] / src / Tests / Tetrahedron.hs
index 159acd7f95bdb11a4a583c994fcd7a0ed350a2ee..1ec4c8e6a0672e2541d383ae233b1e684b801291 100644 (file)
@@ -366,3 +366,27 @@ prop_z_rotation_doesnt_affect_top t =
       fv1 = rotate (Tetrahedron.fv t) cwz
       expr1 = top $ fv0
       expr2 = top $ fv1
+
+prop_swapping_vertices_doesnt_affect_coefficients1 :: Tetrahedron -> Bool
+prop_swapping_vertices_doesnt_affect_coefficients1 t =
+      c t 0 0 1 2 == c t' 0 0 1 2
+        where
+          t' = t { v0 = (v1 t), v1 = (v0 t) }
+
+prop_swapping_vertices_doesnt_affect_coefficients2 :: Tetrahedron -> Bool
+prop_swapping_vertices_doesnt_affect_coefficients2 t =
+      c t 0 1 1 1 == c t' 0 1 1 1
+        where
+          t' = t { v2 = (v3 t), v3 = (v2 t) }
+
+prop_swapping_vertices_doesnt_affect_coefficients3 :: Tetrahedron -> Bool
+prop_swapping_vertices_doesnt_affect_coefficients3 t =
+      c t 2 1 0 0 == c t' 2 1 0 0
+        where
+          t' = t { v2 = (v3 t), v3 = (v2 t) }
+
+prop_swapping_vertices_doesnt_affect_coefficients4 :: Tetrahedron -> Bool
+prop_swapping_vertices_doesnt_affect_coefficients4 t =
+      c t 2 0 0 1 == c t' 2 0 0 1
+        where
+          t' = t { v0 = (v3 t), v3 = (v0 t) }