From 2fa1204d8207f484b23205ecd76255da7c9f1988 Mon Sep 17 00:00:00 2001 From: hasufell Date: Wed, 8 Oct 2014 19:31:55 +0200 Subject: [PATCH] Also connect lines of convex hull --- Diagram.hs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Diagram.hs b/Diagram.hs index 299e820..4acecdb 100644 --- a/Diagram.hs +++ b/Diagram.hs @@ -104,6 +104,18 @@ showConvexHullPoints = Diag f vtch = grahamGetCH vt +showConvexHullLines :: Diag +showConvexHullLines = Diag f + where + f _ vt + = (strokeTrail . + fromVertices . + flip (++) [head $ grahamGetCH vt] . + grahamGetCH $ + vt + ) # moveTo (head $ grahamGetCH vt) # lc red + + -- |Creates a Diagram that shows an XAxis which is bound -- by the dimensions given in xD from DiagProp. showXAxis :: Diag @@ -138,8 +150,8 @@ diag p = case alg p of (mconcat [showCoordinates, showXAxis, showYAxis, showWhiteRectB]) p 1 -> mkDiag - (mconcat [showConvexHullPoints, showCoordinates, - showXAxis, showYAxis, showWhiteRectB]) + (mconcat [showConvexHullPoints, showConvexHullLines, + showCoordinates, showXAxis, showYAxis, showWhiteRectB]) p _ -> mempty