From 4385ef127b3956bba469728d935e6c168e6b4cec Mon Sep 17 00:00:00 2001 From: hasufell Date: Thu, 8 Jan 2015 01:39:23 +0100 Subject: [PATCH] VEC: add sortedYX --- Algebra/Vector.hs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Algebra/Vector.hs b/Algebra/Vector.hs index c23cbe2..121052c 100644 --- a/Algebra/Vector.hs +++ b/Algebra/Vector.hs @@ -140,6 +140,11 @@ sortedXY :: [PT] -> [PT] sortedXY = fmap p2 . sortLex . fmap unp2 +-- |Sort Y and X coordinates lexicographically. +sortedYX :: [PT] -> [PT] +sortedYX = fmap p2 . sortLexSwapped . fmap unp2 + + -- |Sort all points according to their X-coordinates only. sortedX :: [PT] -> [PT] sortedX xs =