Also connect lines of convex hull

This commit is contained in:
hasufell 2014-10-08 19:31:55 +02:00
parent 0677a26040
commit 2fa1204d82
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020

View File

@ -104,6 +104,18 @@ showConvexHullPoints = Diag f
vtch = grahamGetCH vt 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 -- |Creates a Diagram that shows an XAxis which is bound
-- by the dimensions given in xD from DiagProp. -- by the dimensions given in xD from DiagProp.
showXAxis :: Diag showXAxis :: Diag
@ -138,8 +150,8 @@ diag p = case alg p of
(mconcat [showCoordinates, showXAxis, showYAxis, showWhiteRectB]) (mconcat [showCoordinates, showXAxis, showYAxis, showWhiteRectB])
p p
1 -> mkDiag 1 -> mkDiag
(mconcat [showConvexHullPoints, showCoordinates, (mconcat [showConvexHullPoints, showConvexHullLines,
showXAxis, showYAxis, showWhiteRectB]) showCoordinates, showXAxis, showYAxis, showWhiteRectB])
p p
_ -> mempty _ -> mempty