]> gitweb.michael.orlitzky.com - spline3.git/blobdiff - src/Cardinal.hs
Have the show function display the grid size of a cube.
[spline3.git] / src / Cardinal.hs
index c6f7e8f72a9bc112f81d052339971f4b027eaf01..0a1b139ca8b87546b0bd3f9d19ea36a58fe413e5 100644 (file)
@@ -89,3 +89,44 @@ ccwx (Quotient c0 c1) = Quotient (ccwx c0) (ccwx c1)
 -- | Rotate a cardinal direction clockwise about the x-axis.
 cwx :: Cardinal -> Cardinal
 cwx = ccwx . ccwx . ccwx
+
+
+-- | Rotate a cardinal direction counter-clockwise about the y-axis.
+--   TODO: Fix these; they still use the x-axis values.
+ccwy :: Cardinal -> Cardinal
+ccwy F = F
+ccwy B = B
+ccwy L = T
+ccwy R = D
+ccwy D = L
+ccwy T = R
+ccwy FL = FT
+ccwy FR = FD
+ccwy FD = FL
+ccwy FT = FR
+ccwy BL = BT
+ccwy BR = BD
+ccwy BD = BL
+ccwy BT = BR
+ccwy LD = LT
+ccwy LT = RT
+ccwy RD = LD
+ccwy RT = RD
+ccwy FLD = FLT
+ccwy FLT = FRT
+ccwy FRD = FLD
+ccwy FRT = FRD
+ccwy BLD = BLT
+ccwy BLT = BRT
+ccwy BRD = BLD
+ccwy BRT = BRD
+ccwy I = I
+ccwy (Scalar s) = (Scalar s)
+ccwy (Sum c0 c1) = Sum (ccwy c0) (ccwy c1)
+ccwy (Difference c0 c1) = Difference (ccwy c0) (ccwy c1)
+ccwy (Product c0 c1) = Product (ccwy c0) (ccwy c1)
+ccwy (Quotient c0 c1) = Quotient (ccwy c0) (ccwy c1)
+
+-- | Rotate a cardinal direction clockwise about the x-axis.
+cwy :: Cardinal -> Cardinal
+cwy = ccwy . ccwy . ccwy