Debian Codegraph @

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

raw
1 .PS
2 # ex09.m4
3 # Illustrating the arguments of the `dimension_' macro.
4 gen_init
5 sinclude(F_ex09.dim)
6 sinclude(examples.dim)
7 s_init(ex09)
8 scale = 25
9
10 define(`spacer',`
11 [
12 iflatex(`ifpsfrag(`textht = 7.5bp__; textoffset = 0.5bp__',
13 `latexcommand({\sf)') ')
14 linethick_(1.0)
15
16 WC: circle diameter 4.22 at 0,0
17 EC: circle same at 30.15,0
18 NC: circle diameter 2.36 at 13.28, 10.92/2
19 SC: circle same at 13.28,-10.92/2
20
21 C: 0.5<WC,EC> # spacer centre
22 h = 27.26 # spacer height
23 s = 4.22/2 # small arc radius
24 r = h/2*0.80 # large arc radius
25 Cr: C+(0,h/2-r) # upper arc centre
26 e = s # small arc centre offset from small circle
27 Cs: EC+(e,0) # right arc centre
28
29 # Tangent points Tr and Ts to circles at Cr and Cs
30 dx = Cr.x-Cs.x; dy = Cr.y-Cs.y; dsq = dx*dx+dy*dy
31 Tr: (r*(r-s)/dsq)<Cr,Cs> + (vscal_(r*sqrt(dsq-(r-s)^2)/dsq,dy,-dx))
32 Ts: (s/r)<Cr,Tr>-(dx,dy)
33
34 line from Tr to Ts
35 arc cw to (Ts.x,-Ts.y) with .c at Cs
36 E: last arc.e
37 line to (Tr.x,-Tr.y)
38 arc cw to (C.x-(Here.x-C.x),Here.y) with .c at (Cr.x,-Cr.y)
39 S: last arc.s
40 line to (Cs.x-Ts.x-s,Cs.y-Ts.y)
41 arc cw to (Here.x,-Here.y) with .c at (-e,0)
42 W: last arc.w
43 line to (C.x-(Tr.x-C.x),Tr.y)
44 arc cw to Tr with .c at Cr
45 N: last arc.n
46
47 thinlines_
48 dimension_(from S+(2,0) to N+(2,0),-(E.x-C.x+4),s_box(27.76), H)
49 dimension_(from SC.n+(0,2) left SC.x-WC.x, (SC.n.y-S.y+3), s_box(13.28), W)
50 dimension_(from WC.n+(0,2) right EC.x-WC.x,-(WC.n.y-S.y+7), s_box(30.15), W)
51 dimension_(from W+(0,-1.5) to E+(0,-1.5), -(C.y-S.y+8), s_box(41.28), W)
52 dimension_(from SC.e+(2,0) up NC.y-SC.y, (SC.e.x-W.x+8), s_box(10.92), H)
53
54 arrow <- from EC left 6 up 16 chop EC.rad chop 0
55 line left 4 "4.22 (2) PL" above
56 arrow <- from NC up last line.y-NC.y+7/8 left 8 chop NC.rad chop 0
57 {"2.36" above}
58 arrow to SC chop 0 chop SC.rad
59 iflatex(`ifpsfrag(,`latexcommand(})')')
60 ] ')
61
62 define(`sk',`scale*0.7')
63
64 define(`bdot',
65 `dot(`$1',,0.5)
66 s_box($`$2'$\strut) `$1' `$3' ')
67
68 thinlines_
69 # Upper left diagram
70 spacer
71
72 # Lower left diagram
73 [ define(`lwid',`29bp__')
74 A: bdot(at (0,0),A,below)
75 B: bdot(at (2*sk,0),B,below)
76 Ctr: 0.5 between A and B
77
78 linethick_(1)
79 dimension_(from A to B,0.5*sk,\sl label,lwid,0.1*sk)
80 s_box(`\tt dimension\_(from A to B,0.5,\char92 sl label,29bp\_\_,0.1)') \
81 with .sw at A+(-0.8*sk,-0.7*sk)
82
83 thinlines_
84 arrow from A to B chop 0.05*sk "\sl linespec" below
85 dimension_(up_ 0.5*sk from A,0.2*sk,"\sl offset\ {}" rjust,,,->)
86 dimension_(up_ 0.1*sk from B,-0.2*sk)
87 s_box(\ \sl tic offset) with .nw at 2nd last arrow
88 dimension_(up_ 0.1*sk from B+(0,0.5*sk),-0.2*sk)
89 s_box(\ \sl tic offset) with .nw at 2nd last arrow
90 dimension_(from Ctr+(-lwid/2,0.5*sk) right lwid,0.2*sk,
91 "\strut\sl blank width" above)
92 move up 1*sk from A
93 ] with .nw at last [].sw+(0,-0.6*sk)
94
95 # Right diagram
96 [ A: bdot(at (0,0),A, above rjust)
97 B: bdot(at (2*sk,0),B, above ljust)
98 C: bdot(at (0,-1.5*sk),C, above rjust)
99 D: bdot(at (2*sk,-1.5*sk),D, above ljust)
100
101 T: C+(-1*sk,-0.5*sk)
102 T: C+(-0.45*sk,-1.0*sk)
103 dimension_(from A to B,0.3*sk,$AB$,20bp__)
104
105 s_box(`\tt dimension\_(from A to B,0.3,\$AB\$,20bp\_\_)') \
106 with .sw at T
107
108 dimension_(from C to B chop dotrad_,,$X$,16bp__)
109 s_box(`\tt dimension\_(from C to B,,\$X\$,16bp\_\_)') \
110 with .sw at T+(0,-13bp__)
111
112 dimension_(from C to A,0.3*sk,$CA$,14bp__,,->)
113 s_box(`\tt dimension\_(from C to A,0.3,\$CA\$,14bp\_\_,,->)') \
114 with .sw at T+(0,-2*13bp__)
115
116 dimension_(from D to B,-0.3*sk,"$DB$" ljust)
117 s_box(`\tt dimension\_(from D to B,-0.3,\"\$DB\$\" ljust)') \
118 with .sw at T+(0,-3*13bp__)
119
120 dimension_(from C to D chop dotrad_,,s_box($T^{%g}$,15),W)
121 s_box(
122 `\tt dimension\_(from C to D,,s\_box(\$T\char94\char123\%g\char125\$,15),W)')\
123 with .sw at T+(0,-4*13bp__)
124
125 arcdimension_(from C to D with .c at \
126 0.5 between A and B,12bp__,s_box($C$ to $D$),W)
127 s_box(
128 `\tt arcdimension\_(from C to D with .c at \smash{\char92}') \
129 with .sw at T+(0,-5*13bp__)
130 s_box(`\tt 0.5 between A and B,12bp\_\_,s\_box(\$C\$ to \$D\$),W)') \
131 with .sw at T+(5,-6*13bp__)
132
133 ] with .nw at 1st [].ne+(0.8*sk,0)
134
135
136 .PE