import Point
-- | An HUnit assertion that wraps the almost_equals function. Stolen
--- from the definition of 'assertEqual' in Test/HUnit/Base.hs.
+-- from the definition of 'assertEqual' in Test\/HUnit\/Base.hs.
assertAlmostEqual :: String -> Double -> Double -> Assertion
assertAlmostEqual preface expected actual =
unless (actual ~= expected) (assertFailure msg)
-- | An HUnit assertion that wraps the is_close function. Stolen
--- from the definition of 'assertEqual' in Test/HUnit/Base.hs.
+-- from the definition of 'assertEqual' in Test\/HUnit\/Base.hs.
assertClose :: String -> Point -> Point -> Assertion
assertClose preface expected actual =
unless (actual `is_close` expected) (assertFailure msg)
-- | 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
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