ALGO: improve style

This commit is contained in:
hasufell 2014-10-12 03:00:25 +02:00
parent b75f531533
commit cc7efa9906
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020

View File

@ -12,9 +12,9 @@ import MyPrelude
-- algorithm. -- algorithm.
grahamGetCH :: [PT] -> [PT] grahamGetCH :: [PT] -> [PT]
grahamGetCH vs = grahamGetCH vs =
-- merge upper hull with lower hull while discarding -- merge upper hull with lower hull while discarding
-- the duplicated points from the lower hull -- the duplicated points from the lower hull
scan uH uHRest ++ tailInit (scan lH lHRest) scan uH uHRest ++ tailInit (scan lH lHRest)
where where
-- sort lexicographically by x values (ties are resolved by y values) -- sort lexicographically by x values (ties are resolved by y values)
sortedXY = fmap p2 . sortLex . fmap unp2 $ vs sortedXY = fmap p2 . sortLex . fmap unp2 $ vs