summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/RandomNodes.m4
blob: f14973204f2740a80414a2c7b6b52dea688307fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
.PS
# RandomNodes.m4
gen_init
NeedDpicTools

  scale = 2.54
  n = 300
  msiz = 4.90*2
  maxdist = 1.0

  box wid msiz ht msiz with .sw at (0,0)
  for i=1 to n do { X[i] : (rand(), rand())*msiz }
  for i=1 to n-1 do { for j=i+1 to n do {
    if distance(X[i],X[j]) <= maxdist then { 
      line outlined "green" from X[i] to X[j]
      } } }
  for i=1 to n do { circle rad dotrad_ at X[i] shaded "green" }

.PE