File: FieldLines.m4

package info (click to toggle)
circuit-macros 10.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 6,532 kB
  • sloc: makefile: 909; sh: 49
file content (24 lines) | stat: -rw-r--r-- 765 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.PS
# https://tex.stackexchange.com/questions/593866/magnetic-field-with-2-coils
cct_init(SIdefaults)

  setdir_(R)
  W1: winding(,20,5,8,10)
  line dn_ 10 from W1.T1; dot(,,1)
  line dn_ 10 from W1.T2; dot(,,1)
  W2: winding(,20,5,8,10) with .w_ at W1.e_+vec_(10,0)
  line dn_ 10 from W2.T1; dot(,,1)
  line dn_ 10 from W2.T2; dot(,,1)
  for i=2 to -2 by -1 do {
    spline 0.55 \
         from W2.e_+vec_(30,10/4*i*3) \
           to W2.e_+vec_(25,10/4*i*2) \
      then to W2.e_+vec_(0,10/4*i) \
      then to W1.w_+vec_(0,10/4*i) \
      then to W1.w_+vec_(-25,10/4*i*2) \
      then to W1.w_+vec_(-30,10/4*i*3)
    arrow wid 2 ht 2 dn_ i*0.66 rt_ 2 at W1.w_+vec_(-25,10/4*i*2.35)
    arrow wid 2 ht 2 up__ i*0.66 rt_ 2 at W2.e_+vec_(25,10/4*i*2.35)
    }

.PE