Allow more control over the dimensions

This commit is contained in:
2014-10-05 18:09:24 +02:00
parent 6e2873ece1
commit 197dc99058
2 changed files with 30 additions and 15 deletions

15
Util.hs
View File

@@ -1,14 +1,15 @@
module Util where
-- |Checks whether the Coordinates are in a given range.
inRange :: Double -- ^ min
-> Double -- ^ max
-> (Double, Double) -- ^ Coordinates to check
-- |Checks whether the Coordinates are in a given dimension.
inRange :: (Double, Double) -- ^ X dimension
-> (Double, Double) -- ^ Y dimension
-> (Double, Double) -- ^ Coordinates
-> Bool -- ^ result
inRange min' max' (x, y)
| x <= max' && x >= min' && y <= max' && y >= min' = True
| otherwise = False
inRange (xlD, xuD) (ylD, yuD) (x,y)
| x <= xuD && x >= xlD &&
y <= yuD && y >= ylD = True
| otherwise = False
-- |Compare the extension of a file with the given String.