From: Michael Orlitzky Date: Thu, 4 Aug 2011 16:44:01 +0000 (-0400) Subject: Switch all of the tetrahedronX functions to use the new 'rotate' argument order. X-Git-Tag: 0.0.1~249 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=574a15e7ccfa3109f06fa05ed09e2282a03a7dad;p=spline3.git Switch all of the tetrahedronX functions to use the new 'rotate' argument order. Use (rotate $ rotate $ ...) notation instead of composing rotations. Fix all tetrahedron functions so that the trilinear reproduction tests pass. --- diff --git a/src/Cube.hs b/src/Cube.hs index 6b2121c..2ec9e48 100644 --- a/src/Cube.hs +++ b/src/Cube.hs @@ -198,7 +198,7 @@ tetrahedron1 c = v1' = center (front_face c) v2' = Face.v1 (front_face c) v3' = Face.v2 (front_face c) - fv' = rotate (Cube.fv c) cwx + fv' = rotate ccwx (Cube.fv c) tetrahedron2 :: Cube -> Tetrahedron tetrahedron2 c = @@ -208,7 +208,7 @@ tetrahedron2 c = v1' = center (front_face c) v2' = Face.v2 (front_face c) v3' = Face.v3 (front_face c) - fv' = rotate (Cube.fv c) (cwx . cwx) + fv' = rotate ccwx $ rotate ccwx $ Cube.fv c tetrahedron3 :: Cube -> Tetrahedron tetrahedron3 c = @@ -218,7 +218,7 @@ tetrahedron3 c = v1' = center (front_face c) v2' = Face.v3 (front_face c) v3' = Face.v0 (front_face c) - fv' = rotate (Cube.fv c) ccwx + fv' = rotate cwx (Cube.fv c) tetrahedron4 :: Cube -> Tetrahedron tetrahedron4 c = @@ -228,7 +228,7 @@ tetrahedron4 c = v1' = center (top_face c) v2' = Face.v0 (top_face c) v3' = Face.v1 (top_face c) - fv' = rotate (Cube.fv c) ccwy + fv' = rotate cwy (Cube.fv c) tetrahedron5 :: Cube -> Tetrahedron tetrahedron5 c = @@ -238,7 +238,7 @@ tetrahedron5 c = v1' = center (top_face c) v2' = Face.v1 (top_face c) v3' = Face.v2 (top_face c) - fv' = rotate (Tetrahedron.fv (tetrahedron4 c)) cwz + fv' = rotate cwy $ rotate cwz $ Tetrahedron.fv (tetrahedron0 c) tetrahedron6 :: Cube -> Tetrahedron tetrahedron6 c = @@ -248,7 +248,7 @@ tetrahedron6 c = v1' = center (top_face c) v2' = Face.v2 (top_face c) v3' = Face.v3 (top_face c) - fv' = rotate (Tetrahedron.fv (tetrahedron4 c)) (cwz . cwz) + fv' = rotate cwy $ rotate cwz $ rotate cwz $ Tetrahedron.fv (tetrahedron0 c) tetrahedron7 :: Cube -> Tetrahedron tetrahedron7 c = @@ -258,7 +258,7 @@ tetrahedron7 c = v1' = center (top_face c) v2' = Face.v3 (top_face c) v3' = Face.v0 (top_face c) - fv' = rotate (Tetrahedron.fv (tetrahedron4 c)) ccwz + fv' = rotate cwy $ rotate ccwz $ Tetrahedron.fv (tetrahedron0 c) tetrahedron8 :: Cube -> Tetrahedron tetrahedron8 c = @@ -268,7 +268,7 @@ tetrahedron8 c = v1' = center (back_face c) v2' = Face.v0 (back_face c) v3' = Face.v1 (back_face c) - fv' = rotate (Tetrahedron.fv (tetrahedron4 c)) ccwy + fv' = rotate cwy $ rotate cwy $ (Tetrahedron.fv (tetrahedron0 c)) tetrahedron9 :: Cube -> Tetrahedron tetrahedron9 c = @@ -278,7 +278,7 @@ tetrahedron9 c = v1' = center (back_face c) v2' = Face.v1 (back_face c) v3' = Face.v2 (back_face c) - fv' = rotate (Tetrahedron.fv (tetrahedron8 c)) cwx + fv' = rotate cwy $ rotate cwy $ rotate cwx $ Tetrahedron.fv (tetrahedron0 c) tetrahedron10 :: Cube -> Tetrahedron tetrahedron10 c = @@ -288,7 +288,10 @@ tetrahedron10 c = v1' = center (back_face c) v2' = Face.v2 (back_face c) v3' = Face.v3 (back_face c) - fv' = rotate (Tetrahedron.fv (tetrahedron8 c)) (cwx . cwx) + fv' = rotate cwy $ rotate cwy + $ rotate cwx + $ rotate cwx + $ Tetrahedron.fv (tetrahedron0 c) tetrahedron11 :: Cube -> Tetrahedron @@ -299,7 +302,9 @@ tetrahedron11 c = v1' = center (back_face c) v2' = Face.v3 (back_face c) v3' = Face.v0 (back_face c) - fv' = rotate (Tetrahedron.fv (tetrahedron8 c)) ccwx + fv' = rotate cwy $ rotate cwy + $ rotate ccwx + $ Tetrahedron.fv (tetrahedron0 c) tetrahedron12 :: Cube -> Tetrahedron @@ -310,7 +315,7 @@ tetrahedron12 c = v1' = center (down_face c) v2' = Face.v0 (down_face c) v3' = Face.v1 (down_face c) - fv' = rotate (Tetrahedron.fv (tetrahedron8 c)) ccwy + fv' = rotate ccwy (Tetrahedron.fv (tetrahedron0 c)) tetrahedron13 :: Cube -> Tetrahedron @@ -321,7 +326,7 @@ tetrahedron13 c = v1' = center (down_face c) v2' = Face.v1 (down_face c) v3' = Face.v2 (down_face c) - fv' = rotate (Tetrahedron.fv (tetrahedron12 c)) cwz + fv' = rotate ccwy $ rotate ccwz $ Tetrahedron.fv (tetrahedron0 c) tetrahedron14 :: Cube -> Tetrahedron @@ -332,7 +337,9 @@ tetrahedron14 c = v1' = center (down_face c) v2' = Face.v2 (down_face c) v3' = Face.v3 (down_face c) - fv' = rotate (Tetrahedron.fv (tetrahedron13 c)) (cwz . cwz) + fv' = rotate ccwy $ rotate ccwz + $ rotate ccwz + $ Tetrahedron.fv (tetrahedron0 c) tetrahedron15 :: Cube -> Tetrahedron @@ -343,7 +350,7 @@ tetrahedron15 c = v1' = center (down_face c) v2' = Face.v3 (down_face c) v3' = Face.v0 (down_face c) - fv' = rotate (Tetrahedron.fv (tetrahedron12 c)) ccwz + fv' = rotate ccwy $ rotate cwz $ Tetrahedron.fv (tetrahedron0 c) tetrahedron16 :: Cube -> Tetrahedron @@ -354,7 +361,7 @@ tetrahedron16 c = v1' = center (right_face c) v2' = Face.v0 (right_face c) v3' = Face.v1 (right_face c) - fv' = rotate (Tetrahedron.fv (tetrahedron0 c)) cwz + fv' = rotate ccwz (Tetrahedron.fv (tetrahedron0 c)) tetrahedron17 :: Cube -> Tetrahedron @@ -365,7 +372,7 @@ tetrahedron17 c = v1' = center (right_face c) v2' = Face.v1 (right_face c) v3' = Face.v2 (right_face c) - fv' = rotate (Tetrahedron.fv (tetrahedron16 c)) cwy + fv' = rotate ccwz $ rotate cwy $ Tetrahedron.fv (tetrahedron0 c) tetrahedron18 :: Cube -> Tetrahedron @@ -376,7 +383,9 @@ tetrahedron18 c = v1' = center (right_face c) v2' = Face.v2 (right_face c) v3' = Face.v3 (right_face c) - fv' = rotate (Tetrahedron.fv (tetrahedron16 c)) (cwy . cwy) + fv' = rotate ccwz $ rotate cwy + $ rotate cwy + $ Tetrahedron.fv (tetrahedron0 c) tetrahedron19 :: Cube -> Tetrahedron @@ -387,7 +396,8 @@ tetrahedron19 c = v1' = center (right_face c) v2' = Face.v3 (right_face c) v3' = Face.v0 (right_face c) - fv' = rotate (Tetrahedron.fv (tetrahedron16 c)) ccwy + fv' = rotate ccwz $ rotate ccwy + $ Tetrahedron.fv (tetrahedron0 c) tetrahedron20 :: Cube -> Tetrahedron @@ -398,7 +408,7 @@ tetrahedron20 c = v1' = center (left_face c) v2' = Face.v0 (left_face c) v3' = Face.v1 (left_face c) - fv' = rotate (Tetrahedron.fv (tetrahedron0 c)) ccwz + fv' = rotate cwz (Tetrahedron.fv (tetrahedron0 c)) tetrahedron21 :: Cube -> Tetrahedron @@ -409,7 +419,7 @@ tetrahedron21 c = v1' = center (left_face c) v2' = Face.v1 (left_face c) v3' = Face.v2 (left_face c) - fv' = rotate (Tetrahedron.fv (tetrahedron20 c)) cwy + fv' = rotate cwz $ rotate ccwy $ Tetrahedron.fv (tetrahedron0 c) tetrahedron22 :: Cube -> Tetrahedron @@ -420,7 +430,9 @@ tetrahedron22 c = v1' = center (left_face c) v2' = Face.v2 (left_face c) v3' = Face.v3 (left_face c) - fv' = rotate (Tetrahedron.fv (tetrahedron20 c)) (cwy . cwy) + fv' = rotate cwz $ rotate ccwy + $ rotate ccwy + $ Tetrahedron.fv (tetrahedron0 c) tetrahedron23 :: Cube -> Tetrahedron @@ -431,7 +443,8 @@ tetrahedron23 c = v1' = center (left_face c) v2' = Face.v3 (left_face c) v3' = Face.v0 (left_face c) - fv' = rotate (Tetrahedron.fv (tetrahedron20 c)) ccwy + fv' = rotate cwz $ rotate cwy + $ Tetrahedron.fv (tetrahedron0 c) tetrahedrons :: Cube -> [Tetrahedron]