applications.collages.collageAlgebra:
{  
  ntColourLight = const(.8),
  ntColourMedium = const(.6),
  ntColourDark = const(.4),
  
  r = const(5),
  s = const(.8),
  a = const(10),
  
  sample = {
    closedCurve((-#r, 0) right (0, -.56 * #r),
      (0, -#r) right (.56 * #r, 0),
      (#r, 0) right (0, .56 * #r),
      (0, #r) right (-.56 * #r, 0)),
    filledPolygon((0, #r), (#r / 9, #r + #r / 30), (#r / 9.4, #r - #r / 23)),
    polyline((0, #r + #r / 26.5), (0, #r - #r / 26.5)) },
  
  t0 = scale((#s + 5)/6),
  t1 = scale((#s + 2)/3),
  t2 = scale((#s + 1)/2),
  
  x1 = const(-#r * sin(#a / 2)),
  y1 = const(#r * cos(#a / 2)),
  x2 = const(0),
  y2 = const(#y1 * (1 + (1 - #s) / 2)),
  x3 = const(-#x1),
  y3 = const(#y1),
  x1r = const(#x1 * cos(-2 * #a) - #y1 * sin(-2 * #a)),
  y1r = const(#x1 * sin(-2 * #a) + #y1 * cos(-2 * #a)),
  x2r = const(#x2 * cos(-2 * #a) - #y2 * sin(-2 * #a)),
  y2r = const(#x2 * sin(-2 * #a) + #y2 * cos(-2 * #a)),
  x3r = const(#x3 * cos(-2 * #a) - #y3 * sin(-2 * #a)),
  y3r = const(#x3 * sin(-2 * #a) + #y3 * cos(-2 * #a)),
  x4 = const(#x1r * (#s + (1 - #s) * .9)),
  y4 = const(#y1r * (#s + (1 - #s) * .9)),
  x5 = const(#x3r * (#s + (1 - #s) * .8)),
  y5 = const(#y3r * (#s + (1 - #s) * .8)),
  x6 = const(#x2r * #s),
  y6 = const(#y2r * #s),
  x7 = const(#x1r * (#s + (1 - #s) * .8)),
  y7 = const(#y1r * (#s + (1 - #s) * .8)),
  x8 = const(#x3 * (#s + (1 - #s) * .9)),
  y8 = const(#y3 * (#s + (1 - #s) * .9)),
  x9 = const(#s * (#x2 * cos(-#a) - #y2 * sin(-#a))),
  y9 = const(#s * (#x2 * sin(-#a) + #y2 * cos(-#a))),
  x10 = const(#s * (#x3 * cos(-#a) - #y3 * sin(-#a))),
  y10 = const(#s * (#x3 * sin(-#a) + #y3 * cos(-#a))),
    
  rot = rotate(-#a),
  patch = {
    filledPolygon((#x1,#y1),(#x2,#y2),(#x3,#y3),(#x4,#y4),(#x5,#y5),(#x6,#y6),(#x7,#y7),(#x8,#y8)),
    filledPolygon((#x6,#y6),(#x7,#y7),(#x9,#y9),(#x10,#y10))[.8],
    filledPolygon((#x6,#y6),(#x7,#y7),(#x9,#y9),(#x10,#y10))[.8] transformed by rot,
    polygon((#x1,#y1),(#x2,#y2),(#x3,#y3),(#x4,#y4),(#x5,#y5),(#x6,#y6),(#x7,#y7),(#x8,#y8)) transformed by rot
  },
  
  rot0 = rotate(0 * 2 * #a),
  rot1 = rotate(1 * 2 * #a),
  rot2 = rotate(2 * 2 * #a),
  rot3 = rotate(3 * 2 * #a),
  rot4 = rotate(4 * 2 * #a),
  rot5 = rotate(5 * 2 * #a),
  rot6 = rotate(6 * 2 * #a),
  rot7 = rotate(7 * 2 * #a),
  rot8 = rotate(8 * 2 * #a),
  rot9 = rotate(9 * 2 * #a),
  rot10 = rotate(10 * 2 * #a),
  rot11 = rotate(11 * 2 * #a),
  rot12 = rotate(12 * 2 * #a),
  rot13 = rotate(13 * 2 * #a),
  rot14 = rotate(14 * 2 * #a),
  rot15 = rotate(15 * 2 * #a),
  rot16 = rotate(16 * 2 * #a),
  rot17 = rotate(17 * 2 * #a),
  
  circ =
    #patch transformed by rot0 +
    #patch transformed by rot1 +
    #patch transformed by rot2 +
    #patch transformed by rot3 +
    #patch transformed by rot4 +
    #patch transformed by rot5 +
    #patch transformed by rot6 +
    #patch transformed by rot7 +
    #patch transformed by rot8 +
    #patch transformed by rot9 +
    #patch transformed by rot10 +
    #patch transformed by rot11 +
    #patch transformed by rot12 +
    #patch transformed by rot13 +
    #patch transformed by rot14 +
    #patch transformed by rot15 +
    #patch transformed by rot16 +
    #patch transformed by rot17,
    
  G = #circ, %#sample transformed by t1,
  S = #circ, %#sample transformed by t1,
  
  shrink = scale(#s) . rotate(#a),
  shrink = < #circ, shrink >,
  
  grow = scale(1/#s) . rotate(-#a),
  grow = <grow,  #circ >,
  
  grow-shrink = <grow, #circ, shrink  >
  
 
 }
