@@ -3,21 +3,44 @@ include("AngleDoubling.jl")
3
3
4
4
# for each internal address, calculate a screen which shows the future options
5
5
6
+ function wedge! (ax,start,finish,innerrad,outerrad)
7
+ distance = finish - start
8
+ vertex_per_deg = 1
9
+ nvertices = max (2 , ceil (Int, rad2deg (distance) * vertex_per_deg))
10
+
11
+ outerpoints = map (LinRange (start, finish, nvertices)) do rad
12
+ Point2 (cos (rad) * outerrad, sin (rad) * outerrad)
13
+ end
14
+ innerpoints = map (LinRange (finish, start, nvertices)) do rad
15
+ Point2 (cos (rad) * innerrad, sin (rad) * innerrad)
16
+ end
17
+
18
+ points = append! (innerpoints,outerpoints)
19
+
20
+ poly! (ax,points)
21
+ end
22
+
6
23
function drawwedges! (ax,AIA)
7
24
N = AIA. addr[end ]
8
- n = 5
25
+ n = 20
9
26
for ii in N+ 1 : N+ n
10
27
k = denominator (AIA,ii)
11
28
angles = []
29
+ wedges = []
30
+ angletext = []
12
31
for jj in 1 : k- 1
13
32
if gcd (jj,k) == 1
14
33
push! (angles,(jj- 0.5 )* 2 * pi / (k- 1 ))
34
+ push! (angletext, " $jj /$k $ii " )
35
+ push! (wedges,((jj- 1 )* 2 * pi / (k- 1 ),(jj)* 2 * pi / (k- 1 ),2 ^ (ii- 1 ),2 ^ ii))
15
36
end
16
37
end
17
38
r = (2 ^ ii+ 2 ^ (ii- 1 ))/ 2
18
39
centers = [(r* cos (theta),r* sin (theta)) for theta in angles]
19
- pie! (ax,ones (k- 1 ),radius = 2 ^ ii, inner_radius = 2 ^ (ii- 1 ))
20
- text! (ax,centers,text = fill (" $ii " ,length (centers)), align = (:center ,:center ))
40
+ for wedge in wedges
41
+ wedge! (ax,wedge... )
42
+ end
43
+ text! (ax,centers,text = angletext, align = (:center ,:center ))
21
44
end
22
45
end
23
46
0 commit comments