File: RandomNodes.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 (19 lines) | stat: -rw-r--r-- 410 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
.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