X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FCardinal.hs;h=9032fbdfd4312907474c9b0e4da32928a8add648;hb=574a15e7ccfa3109f06fa05ed09e2282a03a7dad;hp=9a5d025efa9c43537aba416491b4fb10fa8e2494;hpb=f07f76b231a3df623aab8b6035ac6000ce2a5eb2;p=spline3.git diff --git a/src/Cardinal.hs b/src/Cardinal.hs index 9a5d025..9032fbd 100644 --- a/src/Cardinal.hs +++ b/src/Cardinal.hs @@ -1,6 +1,6 @@ -- | The Cardinal module contains the Cardinal data type, representing --- a cardinal direction (one of the 27 directions surrounding the --- center of a cube. In addition to those 27 directions, we also +-- a cardinal direction (one of the 26 directions surrounding the +-- center of a cube. In addition to those 26 directions, we also -- include the interior point and a number of composite types that -- allow us to perform arithmetic on directions. module Cardinal @@ -46,7 +46,7 @@ data Cardinal = F -- ^ Front deriving (Show, Eq) --- | By making Cardinal an instance of Num, we gain the ability to +-- | By making Cardinal an instance of 'Num', we gain the ability to -- add, subtract, and multiply directions. The results of these -- operations are never actually calculated; the types just keep -- track of which operations were performed in which order. @@ -60,7 +60,7 @@ instance Num Cardinal where fromInteger x = Scalar (fromIntegral x) --- | Like the Num instance, the Fractional instance allows us to +-- | Like the Num instance, the 'Fractional' instance allows us to -- take quotients of directions. instance Fractional Cardinal where x / y = Quotient x y @@ -150,32 +150,32 @@ cwy = ccwy . ccwy . ccwy -- | Rotate a cardinal direction counter-clockwise about the z-axis. ccwz :: Cardinal -> Cardinal -ccwz F = L -ccwz B = R -ccwz L = B -ccwz R = F +ccwz F = R +ccwz B = L +ccwz L = F +ccwz R = B ccwz D = D ccwz T = T -ccwz FL = BL -ccwz FR = FL -ccwz FD = LD -ccwz FT = LT -ccwz BL = BR -ccwz BR = FR -ccwz BD = RD -ccwz BT = RT -ccwz LD = BD -ccwz LT = BT -ccwz RD = FD -ccwz RT = FT -ccwz FLD = BLD -ccwz FLT = BLT -ccwz FRD = FLD -ccwz FRT = FLT -ccwz BLD = BRD -ccwz BLT = BRT -ccwz BRD = FRD -ccwz BRT = FRT +ccwz FL = FR +ccwz FR = BR +ccwz FD = RD +ccwz FT = RT +ccwz BL = FL +ccwz BR = BL +ccwz BD = LD +ccwz BT = LT +ccwz LD = FD +ccwz LT = FT +ccwz RD = BD +ccwz RT = BT +ccwz FLD = FRD +ccwz FLT = FRT +ccwz FRD = BRD +ccwz FRT = BRT +ccwz BLD = FLD +ccwz BLT = FLT +ccwz BRD = BLD +ccwz BRT = BLT ccwz I = I ccwz (Scalar s) = (Scalar s) ccwz (Sum c0 c1) = Sum (ccwz c0) (ccwz c1)