Код: Выделить всё
from importantConstants import Constant as const
c = const.SPEED_OF_LIGHT #299792458
g = const.GRAVITATIONAL_CONST #6.6743e-11
def calculate(M, r, timeNearBlackHole):
"""
M: Mass of the black hole (kg)
c: Speed of light (m/s)
G: Gravitational constant (m^3 kg^-1 s^-2)
r: Radial distance from the center of the black hole (m)
"""
tDistantObserver = timeNearBlackHole / ((1 - (2 * g * M) / r * pow(c, 2)) ** 0.5)
return float(abs(tDistantObserver))
print(calculate(5e30, 10000, 1))
Код: Выделить всё
1.2911492141401563e-17Подробнее здесь: https://stackoverflow.com/questions/798 ... -correctly
Мобильная версия