Figure 2.19:

Periodic (left) and quasiperiodic (right) orbits on the surface of a torus. The orbit on the right eventually passes through every point in the domain.

Code for Figure 2.19

Text of the GNU GPL.

main.m


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
pq = sqrt(2);
phi0 = 0;
theta0 = 0;

phi = linspace (theta0, 50*pi, 5001);

theta = pq*(phi-phi0) + theta0;
thetamod = mod(theta, 2*pi)/pi;
phimod = mod(phi, 2*pi)/pi;

plot(phimod,thetamod,'.');

data = [phimod', thetamod'];

save "tori_irrat.dat"  data