secret
Created

Spaghettification code for M87

  • Download Gist
spaghetti.r
Rebol
1 2 3 4 5 6 7 8 9 10 11 12
function force=newtons_law(d, b_mass) # d[m], b[kg]
G=6.67384e-11; # Nm^2/kg^2, Newtonian grav. constant
sun_mass=1.9884e+30; # kg
bh_factor=6.7e+9; # M87 black hole multiplication factor
force=(G.*bh_factor.*sun_mass.*b_mass)./(d.*d);
endfunction
 
AU=149597870700;
x=130:10:2000;
 
plot(x, newtons_law(x*AU+2, 10)-newtons_law(x*AU, 2.5))
semilogy(x, newtons_law(x*AU+2, 10)-newtons_law(x*AU, 2.5))

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.