@@ -14,7 +14,7 @@ struct RationalAngle <: Number
14
14
end
15
15
end
16
16
17
- import Base: + , * , / , < , > , numerator, denominator
17
+ import Base: + , * , / , < , > , numerator, denominator, convert
18
18
19
19
phi:: RationalAngle + theta:: RationalAngle = RationalAngle (mod (phi. value+ theta. value,1 ))
20
20
theta:: RationalAngle * s:: Number = RationalAngle (mod (theta. value* s,1 ))
@@ -66,6 +66,10 @@ function KneadingSequence(angle::RationalAngle)
66
66
return thetaitinerary (angle,orb)
67
67
end
68
68
69
+ function KneadingSequence (theta:: Rational )
70
+ return KneadingSequence (RationalAngle (theta))
71
+ end
72
+
69
73
function thetaitinerary (theta:: RationalAngle ,angle:: RationalAngle )
70
74
return thetaitinerary (theta,orbit (angle))
71
75
end
@@ -90,16 +94,7 @@ function thetaitinerary(theta::RationalAngle,orb::Sequence)
90
94
return Sequence {KneadingSymbol} (itinerary,orb. preperiod)
91
95
end
92
96
93
- function Base. show (io:: IO , K:: KneadingSequence )
94
- str = join ([repr (item) for item in K. items])
95
- L = K. preperiod
96
- if L == 0
97
- return println (io," |" * str* " |" )
98
- else
99
- return println (io,str[1 : L]* " |" * str[L+ 1 : end ]* " |" )
100
- end
101
- end
102
-
97
+ """ An internal address is an increasing sequence of integers which describes a kneading sequence"""
103
98
struct InternalAddress
104
99
addr:: Vector{Int}
105
100
end
@@ -198,6 +193,7 @@ function admissible(intadd::InternalAddress)
198
193
return admissible (KneadingSequence (intadd))
199
194
end
200
195
196
+ """ an internal address with aditional information in the form of angles which specify a cyclic ordering of kneading sequences"""
201
197
struct AngledInternalAddress
202
198
addr:: Vector{Int}
203
199
angles:: Vector{RationalAngle}
@@ -223,6 +219,10 @@ function AngledInternalAddress(theta::RationalAngle)
223
219
224
220
end
225
221
222
+ function AngledInternalAddress (theta:: Rational )
223
+ return AngledInternalAddress (Rationalangle (theta))
224
+ end
225
+
226
226
function firstaddress (intadd:: Vector{Int} )
227
227
d = denominators (intadd)
228
228
angles = [1 // x for x in d]
@@ -357,13 +357,15 @@ Base.Int(d::Digit) = d.value
357
357
358
358
const BinaryExpansion = Sequence{Digit{2 }}
359
359
360
+ """ The binary expansion of an angle is a sequence of 1s and 0s which can be interpreted either as place-value representation of the angle, or as an itinerary of the angle under angle doubling.
361
+ """
360
362
function BinaryExpansion (theta:: RationalAngle )
361
363
orb = orbit (theta)
362
364
itinerary = Digit{2 }[]
363
365
zero = Digit {2} (0 )
364
366
one = Digit {2} (1 )
365
367
for theta in orb. items
366
- if theta < 1 // 2
368
+ if theta < RationalAngle ( 1 // 2 )
367
369
push! (itinerary,zero)
368
370
else
369
371
push! (itinerary,one)
0 commit comments