Debian Codegraph @

texmf-dist/doc/latex/circuit-macros/examples/ex15.m4

raw
1 .PS
2 # ex15.m4
3 gen_init
4
5 [
6 n = 10; r = 1
7 for i = 1 to n-1 do {
8 for j = i+1 to n do {
9 line from rect_(r,i*twopi_/n) to rect_(r,j*twopi_/n)
10 }
11 }
12 ]
13 [
14 linethick = 2.5
15 crad = 1.0
16 C: circle rad crad
17 g = 0.65
18 D: C+(Rect_(crad*g,110))
19 rm = crad+distance(C,D)
20 for r=lthick to rm by 2*lthick do {
21 if r < (1-g)*crad then { circle rad r at D thick r/rm*linethick } \
22 else { arc cw from Cintersect(D,r,C,crad) \
23 to Cintersect(D,r,C,crad,R) with .c at D thick r/rm*linethick }
24 }
25
26 linethick = 1.5
27 C: circle invis rad crad with .w at C.e+(0.1,0)
28 D: C+(Rect_(crad*g,110))
29 a = 1 # fade rate parameter
30 for r=lthick to rm by lthick do {
31 u = 1-(r/rm*(a*r/rm+(1-a)))
32 if r < (1-g)*crad then { circle outlined rgbstring(u,u,u) rad r at D } \
33 else { arc cw outlined rgbstring(u,u,u) from Cintersect(D,r,C,crad) \
34 thick linethick*1.5 to Cintersect(D,r,C,crad,R) with .c at D
35 }
36 }
37 circle rad C.rad at C
38 ] with .w at last [].e+(0.1,0)
39
40 .PE