ALGO: improve style
This commit is contained in:
parent
b75f531533
commit
cc7efa9906
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user