%display latex
# %load_ext line_profiler # line by line profiling
S = manifolds.Sphere(stereo2d=True, stereo_lim=2)
A = S.top_charts()[2] # spherical chart
t = var('t')
p = S((pi/2, 0.1), A)
Tp = S.tangent_space(p)
v = Tp((1, -1))
c = S.integrated_geodesic(S.metric(), (t, 0, 4), v, across_charts=True)
#%lprun -f c.solve_across_charts sol = c.solve_across_charts(step=0.02) # line by line profiling
sol = c.solve_across_charts(step=0.02)
interp = c.interpolate()
P = c.plot_integrated(mapping=S.embedding(), color=["red","green","blue","yellow"], thickness=3, plot_points=100, across_charts=True)
P += A.plot(number_values=15, chart=S.ambient().default_chart(), mapping=S.embedding(), color='grey')
P.show(viewer='threejs', online=True)
for inter in interp:
print inter[0]
Chart (A, (th, ph)) Chart (U, (x, y)) Chart (V, (xp, yp)) Chart (U, (x, y))