1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 import numpy as np import matplotlib.pyplot as plt pq = np.sqrt(2) phi0 = 0 theta0 = 0 phi = np.linspace(theta0, 50 * np.pi, 5001) theta = pq * (phi - phi0) + theta0 thetamod = np.mod(theta, 2 * np.pi) / np.pi phimod = np.mod(phi, 2 * np.pi) / np.pi plt.plot(phimod, thetamod, '.') plt.show(block=False) data = np.column_stack((phimod, thetamod)) with open("tori_irrat.dat", "w") as f: np.savetxt(f, data, fmt='%f')