X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FCardinal.hs;h=0a1b139ca8b87546b0bd3f9d19ea36a58fe413e5;hb=cbbeea229379dddceef60795197ebbe0e924257c;hp=c6f7e8f72a9bc112f81d052339971f4b027eaf01;hpb=c88ec8e43960514d27a6368d864a68e07eb18e50;p=spline3.git diff --git a/src/Cardinal.hs b/src/Cardinal.hs index c6f7e8f..0a1b139 100644 --- a/src/Cardinal.hs +++ b/src/Cardinal.hs @@ -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