applications.collages.collageAlgebra:
{
  ntColour = const(.8),
  
  line = { polyline((0,.5),(1,.5)) },
  cap = { polyline((.25,.25),(.25,.75),(.75,.75),(.75,.25)) },
  
  sample-outline = { polyline((.25,.25),(.25,.75),(.75,.75),(.75, .25)) },
  sample-arrow = { filledPolygon((.75,.25),(.7,.38),(.8,.38)) },
  sample-filled = { filledPolygon((.25,.25),(.25,.75),(.75,.75),(.75, .25))[#ntColour,#ntColour,#ntColour] },
  sample = #sample-filled + #sample-outline + #sample-arrow,
  H = #sample,
  
  sample-outline2 = { polyline((0,.5),(1, .5)) },
  sample-arrow2 = { filledPolygon((1,.5),(.85,.44),(.85,.56)) },
  sample-filled2 = { filledPolygon((0,.5),(1, .5),(.5,0))[#ntColour,#ntColour,#ntColour] },
  sample2 = #sample-filled2 + #sample-outline2 + #sample-arrow2,
  A = #sample2,
  
  h1 = map((0,1) -> (.5,0), (1,1) -> (.5,.5)),
  h2 = similarity((0,0) -> (0,.5), (1,0) -> (.5,.5)),
  h3 = similarity((0,0) -> (.5,.5), (1,0) -> (1,.5)),
  h4 = map((0,0) -> (1,.5), (0,1) -> (.5,.5), (1,0) -> (1,0)),
  c1 = scale(.5) . use(h1) . translate(0,.375),
  c2 = scale(.25) . translate(.375,.5),
  c3 = scale(.5) . use(h4) . translate(0,.125),
  F = < h1, c1, h2, c2, h3, c3, h4 >, 
  
  g = scale(.5) . translate(.25,0),
  G = <g>,
  
  shift = translate(-.5,-.5),
  shift = <shift>
  
}
