# Orbits of rotations

By default, we will represent points in the circle by numbers in the interval $[0,1)$. The following function converts from these coordinates to the unit circle.

In :
def to_unit_circle(x):
return (cos(2*pi*x), sin(2*pi*x))


Here is an example of the use of the function above:

In :
to_unit_circle(0)

(1, 0)

Note that the output of the last command in a block is automatically printed in Jupyter.

In :
to_unit_circle(1/4)

(0, 1)
In :
to_unit_circle(1)

(1, 0)

The following function returns the rotation of the circle by alpha.

In :
def rotation(alpha):
def T(x):
val = x+alpha
return val - floor(val)
return T


The following constructs the rotation by 2/5:

In :
T = rotation(2/5)


Here we test it:

In :
T(0)

2/5
In :
T(4/5)

1/5

The following is a function that computes the forward orbit of $x$ under $T$ up until time $N$. So, this returns the list of values $[x,T(x), \ldots, T^N(x)].$

In :
def forward_orbit(x, T, N):
orbit = [x] # Start of the orbit.
y = x
for i in range(N):
y = T(y) # Redefine y to be T(y)
orbit.append(y) # Add y at the end of the orbit.
return orbit


Here we see that $0$ has a periodic orbit of least period $5$:

In :
orbit = forward_orbit(0,T,5)
orbit

[0, 2/5, 4/5, 1/5, 3/5, 0]

The following converts orbit into circle coordinates:

In :
circle_orbit = [to_unit_circle(x) for x in orbit]
circle_orbit

[(1, 0), (-1/4*sqrt(5) - 1/4, 1/4*sqrt(-2*sqrt(5) + 10)), (1/4*sqrt(5) - 1/4, -1/4*sqrt(2*sqrt(5) + 10)), (1/4*sqrt(5) - 1/4, 1/4*sqrt(2*sqrt(5) + 10)), (-1/4*sqrt(5) - 1/4, -1/4*sqrt(-2*sqrt(5) + 10)), (1, 0)]

We can plot the circle_orbit:

In :
line2d(circle_orbit, aspect_ratio=1) Here we plot two orbits:

In :
plt1 = line2d(circle_orbit, aspect_ratio=1)
orbit2 = forward_orbit(1/3, T, 5)
circle_orbit2 = [to_unit_circle(x) for x in orbit2]
plt2 = line2d(circle_orbit2, aspect_ratio=1, color="red")
plt1 + plt2 # Addition combines plots ## An irrational orbit:

Sage can do exact arithmetic in the field AA of all algebraic reals. For more infromation on AA see: http://doc.sagemath.org/html/en/reference/number_fields/sage/rings/qqbar.html.

In :
AA

Algebraic Real Field
In :
alpha = AA(sqrt(2)-1)
alpha

0.4142135623730951?
In :
T = rotation(alpha)

In :
T(0)

0.4142135623730951?
In :
orbit = forward_orbit(0,T,100)

In :
circle_orbit = [to_unit_circle(x) for x in orbit]

In :
line2d(circle_orbit, aspect_ratio=1) Of course, the full infinitely long forward orbit of any point is dense, as we will prove in class. Also see Devaney's Theorem 3.13.