summaryrefslogtreecommitdiff
path: root/graphics/circuit_macros/examples/GrayCode.m4
blob: 4fc4815cf15821a9f669212d8a52a4d858b5933f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
.PS
# GrayCode.m4
gen_init

  outer = 4
  inner = 0.75
  nbits = 10

C: circle diam outer
  circle diam inner at C
  sectors = 2^nbits
  lthk = (outer-inner)/2/nbits
  for bit = 1 to nbits do {
    for is = 2^(bit-1) to sectors by 2^(bit+1) do {
      startang = is/sectors*360
      endang = min(startang+(2^bit)/sectors*360,360)
      arcd(C,outer/2-(bit-0.5)*lthk,startang,endang) thick lthk/(1bp__)
      }
    }
.PE