summaryrefslogtreecommitdiff
path: root/graphics/circuit_macros/examples/MC.m4
blob: 6e4eb88ea0df930e8bcbd1f05759cd7f2e3fea92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
.PS
# MC.m4
cct_init

  dv = dimen_*0.6
  dh = dimen_*0.4
  backup = dimen_/6

  for i=1 to 3 do {{
    if i==2 then { Input: dot } else { line up (2-i)*dv }
    source(right_ dimen_,AC); llabel(,,sprintf("$v_{\char%g}$",96+i))
    resistor(right_ dimen_ from Here-(backup/2,0)); if i==1 then { llabel(,R_i)}
    inductor(right_ dimen_ from Here-(backup,0),W); if i==1 then { llabel(,L_i)}
    line right_ i*dh; b_current(sprintf("\strut$i_{\char%g}$",96+i)); dot
    { line down (3-i)*dv; capacitor(down_ dimen_)
      if i==1 then { rlabel(,C_i) }
      if i==2 then { dot(ifgpic(at last line.end)) } \
      else { line ifgpic(from last line.end) right (2-i)*dh }
      }
    line right 3*dh; dot
    E: Here+((3-i)*dh+dimen_*3/2,(4-2*i)*dv)
    for j=1 to 3 do {{
      line up (6-j*3)*dv then right (3-i)*dh
      switch(right_ E.x-Here.x)
      llabel(,,sprintf("$S_{\char%g\char%g}$",96+i,64+j))
      if i==2 then { dot } else { line down (2-i)*dv }
      }}
    line from E right dh then down E.y-Here.y
    arrow right dimen_/2 ; { sprintf("\strut$i_{\char%g}\quad$",64+i) above }
    resistor(right_ dimen_ from Here-(arrowht/2,0)); if i==1 then {llabel(,R_o)}
    inductor(right_ dimen_ from Here-(backup,0),W);  if i==1 then {llabel(,L_o)}
    source(right_ dimen_,AC); llabel(sprintf("$v_{\char%g}$",64+i))
    if i==2 then { Output: dot } else { line down (2-i)*dv }
    }}
.PE