Author Brent Yorgey
 Title Lozenge
 Created at Tue Dec 3 13:40:35 UTC 2013
 Parent paste  #246
strip :: (Double -> Double) -> Double -> Double -> Int -> Double -> Diagram SVG R2
strip f lo hi n offset
  = [lo, lo + (hi - lo) / (fromIntegral n - 1) .. hi]
  # map (square . f)
  # hcat' with {sep = offset, catMethod = Distrib}
  # fc black
  
example = vcat' with { sep = 3, catMethod = Distrib } (replicate 7 str)
        # centerXY # pad 1.5
  where str = strip (\x -> cos x + 1) (-pi) pi 23 3
Result
Warning
This binding for ‛offset’ shadows the existing binding
imported from ‛Diagrams.Prelude’
(and originally defined in ‛Diagrams.Trail’)
Warning
Top-level binding with no type signature:
example :: QDiagram SVG R2 Any