# 2D-kromme import numpy as np def my_arsinh (x): y = np.log (x + np.sqrt (x**2 + 1)) return y J = 2.5 Rs = 1 h1 = 1 - 3 * Rs**2 / J**2 h2 = np.sqrt (h1) h3 = np.sqrt (h2) n2 = (1 + h2) / (3 * Rs) rbegin = 0.999999 / n2 reinde = 0.999999999 aantalstappen = 4 * 10**8 stap = (reinde - rbegin) / aantalstappen phi0 = my_arsinh (1) r = rbegin - stap while r > reinde: r = r + stap phi = 2 / h3 * (phi0 - my_arsinh (h3 / np.sqrt (Rs / r - 1 / 3 - h2 / 3))) x = r * np.cos (phi) y = r * np.sin (phi) print ('{:10.5e}'.format (x), '{:10.5e}'.format (y))