import numpy as np
from einsteinpy.geodesic import Timelike
from einsteinpy.plotting import StaticGeodesicPlotter
metric_params
Note that, we are working in M-Units ($G = c = M = 1$).
# Constant Radius Orbit
position = [4, np.pi / 3, 0.]
momentum = [0., 0.767851, 2.]
a = 0.99
steps = 400.
delta = 0.5
geod = Timelike(
metric="Kerr",
metric_params=(a,),
position=position,
momentum=momentum,
steps=steps,
delta=delta,
return_cartesian=True
)
%matplotlib widget
#widget
# Use %matplotlib ipympl instead if you are working in Visual Studio Code.
# You may need to `pip install ipympl` first.
sgpl = StaticGeodesicPlotter()
sgpl.animate(geod, interval=1)
sgpl.show()
# You may need to install imagemagick separately to save the animation as a gif
# sgpl.ani.save('animation.gif', writer='imagemagick', fps=30)