Debian Codegraph @

texmf-dist/doc/latex/circuit-macros/examples/extras/FieldLines.m4

raw
1 .PS
2 # https://tex.stackexchange.com/questions/593866/magnetic-field-with-2-coils
3 cct_init(SIdefaults)
4
5 setdir_(R)
6 W1: winding(,20,5,8,10)
7 line dn_ 10 from W1.T1; dot(,,1)
8 line dn_ 10 from W1.T2; dot(,,1)
9 W2: winding(,20,5,8,10) with .w_ at W1.e_+vec_(10,0)
10 line dn_ 10 from W2.T1; dot(,,1)
11 line dn_ 10 from W2.T2; dot(,,1)
12 for i=2 to -2 by -1 do {
13 spline 0.55 \
14 from W2.e_+vec_(30,10/4*i*3) \
15 to W2.e_+vec_(25,10/4*i*2) \
16 then to W2.e_+vec_(0,10/4*i) \
17 then to W1.w_+vec_(0,10/4*i) \
18 then to W1.w_+vec_(-25,10/4*i*2) \
19 then to W1.w_+vec_(-30,10/4*i*3)
20 arrow wid 2 ht 2 dn_ i*0.66 rt_ 2 at W1.w_+vec_(-25,10/4*i*2.35)
21 arrow wid 2 ht 2 up__ i*0.66 rt_ 2 at W2.e_+vec_(25,10/4*i*2.35)
22 }
23
24 .PE