diff --git a/Algorithms/ConvexHull/GrahamScan.hs b/Algorithms/ConvexHull/GrahamScan.hs index ce3544f..8a75926 100644 --- a/Algorithms/ConvexHull/GrahamScan.hs +++ b/Algorithms/ConvexHull/GrahamScan.hs @@ -82,13 +82,13 @@ grahamCH vs = grahamUCH vs ++ (tailInit . grahamLCH $ vs) -- |Get the lower part of the convex hull. grahamLCH :: [PT] -> [PT] grahamLCH vs = uncurry (\x y -> last . scanH x $ y) - (first reverse . splitAt 3 . sortedXY $ vs) + (first reverse . splitAt 3 . sortedXY $ vs) -- |Get the upper part of the convex hull. grahamUCH :: [PT] -> [PT] grahamUCH vs = uncurry (\x y -> last . scanH x $ y) - (first reverse . splitAt 3 . reverse . sortedXY $ vs) + (first reverse . splitAt 3 . reverse . sortedXY $ vs) -- |This scans only a half of the convex hull, but all steps (the last @@ -119,10 +119,10 @@ grahamCHSteps c xs' ys' = take c . scanH xs' $ ys' -- |Get all iterations of the upper hull of the graham scan algorithm. grahamUHSteps :: [PT] -> [[PT]] grahamUHSteps vs = - (++) [getLastX 2 . sortedXY $ vs] . - rmdups . - grahamCHSteps ((* 2) . length $ vs) uH $ - uHRest + (++) [getLastX 2 . sortedXY $ vs] + . rmdups + . grahamCHSteps ((* 2) . length $ vs) uH + $ uHRest where (uH, uHRest) = first reverse . splitAt 3 . reverse . sortedXY $ vs @@ -130,9 +130,9 @@ grahamUHSteps vs = -- |Get all iterations of the lower hull of the graham scan algorithm. grahamLHSteps :: [PT] -> [[PT]] grahamLHSteps vs = - (++) [take 2 . sortedXY $ vs] . - rmdups . - grahamCHSteps ((* 2) . length $ vs) lH $ - lHRest + (++) [take 2 . sortedXY $ vs] + . rmdups + . grahamCHSteps ((* 2) . length $ vs) lH + $ lHRest where (lH, lHRest) = first reverse . splitAt 3 . sortedXY $ vs diff --git a/Algorithms/PolygonIntersection/Core.hs b/Algorithms/PolygonIntersection/Core.hs index 0f32d9f..f8d3a85 100644 --- a/Algorithms/PolygonIntersection/Core.hs +++ b/Algorithms/PolygonIntersection/Core.hs @@ -127,8 +127,8 @@ intersectionPoints xs' = rmdups . go $ xs' segIntersections :: ([Segment], [Segment]) -> [PT] segIntersections (a@(_:_), b@(_:_)) = catMaybes - . fmap (\[x, y] -> intersectSeg' x y) - $ combinations a b + . fmap (\[x, y] -> intersectSeg' x y) + $ combinations a b segIntersections _ = [] -- Gets all unique(!) combinations of two arrays. Both arrays