.PS
# ex02.m4
cct_init
linewid = linewid*4/5

[
  [ 
  for angl=0 to 315 by 45 do {
     Point_(angl)
     opamp(to rvec_(linewid*3/2,0)) with .Out at (0,0) }
     ]
 resistor(down_ dimen_ from last [].s)
 diode(down_ dimen_*2/3,LE) 
 diode(down_ dimen_*2/3,LER) 
 ground(,T)
]

[
 define(`elen_',`dimen_*3/2')          # restore defaults
 define(`sourcerad_',`dimen_*0.25')
 leng = elen_
 define(`fromcentre',`move to C+(-elen_/2,-elen_*cosd(15)/(2*sind(15)))')
 C: dot
 { fromcentre()
   for i = 0 to 359 by 30 do { Point_(i); inductor }
   }
  define(`elen_',leng*0.8)
  { fromcentre()
    for i=0 to 359 by 30 do { Point_(i); inductor(,W) }
    }
  define(`elen_',leng*0.6)
  { fromcentre()
    for i=0 to 359 by 30 do { Point_(i); resistor }
    }
  define(`elen_',leng*0.4)
  { fromcentre()
    for i=0 to 359 by 30 do { Point_(i); capacitor(,C) }
    }
  define(`elen_',leng*0.2)
  { fromcentre()
    for i=0 to 359 by 30 do { Point_(i); diode }
    }
  define(`elen_',`dimen_*3/2')
  ] with .sw at last [].se+(linewid,0)

[
linewid *=1.5
for ang=0 to 359 by 30 do {
  ebox(from (0,0) to (Rect_(elen_,ang)))
  hatchbox(boxdir=ang;angle=70;hatchspec=thick 0.4 outlined "red";
    wid=dimen_/2; ht=dimen_/5; hatchsep=dimen_/2/5) at last []
  }
  ] with .sw at last [].se+(linewid,0)

.PE
