cga/Util.hs

14 lines
354 B
Haskell
Raw Normal View History

2014-09-30 22:05:29 +00:00
module Util where
-- |Checks whether the Coordinates are in a given range.
inRange :: Double -- ^ min
2014-09-30 22:05:29 +00:00
-> Double -- ^ max
-> (Double, Double) -- ^ Coordinates to check
2014-09-30 22:05:29 +00:00
-> Bool -- ^ result
inRange min' max' (x, y)
2014-09-30 22:05:29 +00:00
| x <= max' && x >= min' && y <= max' && y >= min' = True
| otherwise = False