From: Michael Orlitzky Date: Fri, 6 May 2011 22:08:17 +0000 (-0400) Subject: Add a bunch of broken y-axis rotations (still using the x-axis code). X-Git-Tag: 0.0.1~338 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=32c30cbb320650508dfd19eade9de84d3111d0d2;p=spline3.git Add a bunch of broken y-axis rotations (still using the x-axis code). --- diff --git a/src/Cardinal.hs b/src/Cardinal.hs index c6f7e8f..c6d98db 100644 --- a/src/Cardinal.hs +++ b/src/Cardinal.hs @@ -89,3 +89,43 @@ 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 x-axis. +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