applications.collages.collageAlgebra:
  attributes r,g,b,rc,gc,bc,f;
{
  sq = { filledPolygon((-5,0),(5,0),(5,10),(-5,10))<r,g,b;rc=1,gc=1/2,bc=1/2> },
  circ = {filledEllipse(0,0,1.5,1.5)<r,g,b;rc=0.1,gc=0.05,bc=0, f=1>},
  S = #sq,

  f1 = scale(.6) . translate(0,-.05),
  f2 = scale(.6,.5) . translate(0,4.85),%5.05),
  f3 = rotate(4) . scale(.6) . translate(-2,2.3),
  f4 = rotate(-4) . scale(.6) . translate(2,2.3),
  F = <f3,f4,f2,f1>,
  
  g1 = scale(.6) . translate(0,-.05),
  g2 = scale(.6,.4) . translate(0,5),
  g3 = rotate(5) . scale(.5,.6) . translate(-2,2),
  g4 = rotate(-5) . scale(.5,.6) . translate(2,2),
  G = <g3,g4,g2,g1>,
  
  fl1 = scale(1),
  fl2 = rotate(70),
  fl3 = rotate(140),
  fl4 = rotate(210),
  fl5 = rotate(280),
  FL = <fl1,fl2,fl3,fl4,fl5>,
  
  c = scale(.85),
  C = <#circ, c>,
  cc = colourOperation(rc|.2:.4,gc|.1:.2,bc|.1:.1),

  c1 = colourOperation(f|.35:0),
  c2 = colourOperation(f|.375:.7),
  c3 = colourOperation(f|.65:1),
  
  choose1 = colourOperation(gc|1/2:.5,bc|1/2:0),
  choose2 = colourOperation(gc|1/2:0,bc|1/2:1),
  choose3 = colourOperation(gc|1/2:0,bc|1/2:0),
  choose4 = colourOperation(rc| 1/2:1/2,gc|1/2:0,bc|2/3:1),
  choose5 = colourOperation(rc| 2/3:1,gc|1/2:0,bc|1/2:1/2),
  set = colourOperation(r|val(f):val(rc),g|val(f):val(gc),b|val(f):val(bc)),
  
  div1 = scale(.5) . translate(-3.5,-3.5),
  div2 = scale(.5) . translate(3.5,-3.5),
  div3 = scale(.5) . translate(3.5,3.5),
  div4 = scale(.5) . translate(-3.5,3.5),
  DIV = <div1,div2,div3,div4>,  
  
  t1 = translate(5,5),
  t2 = translate(-5,-5),
  t3 = translate(-5,5),
  t4 = translate(5,-5),
  T1 = <t1>,
  T2 = <t2>,
  T3 = <t3>,
  T4 = <t4>,
  
  r1 = rotate(25),
  r2 = scale(-1,1) . rotate(70),
  r3 = rotate(190),
  r4 = scale(1,-1) . rotate(250),
  R1 = <r1>,
  R2 = <r2>,
  R3 = <r3>,
  R4 = <r4>,
  
  s1 = scale(.95),
  s2 = scale(.98),
  s3 = scale(1.02),
  s4 = scale(1.05),
  S1 = <s1>,
  S2 = <s2>,
  S3 = <s3>,
  S4 = <s4>
  
}
