Commit ee15064f authored by Thomas Dauser's avatar Thomas Dauser

adds new function to calculate the grav radius

parent cea03836
Pipeline #6126 passed with stages
in 42 seconds
%!%+
%\function{gravitational_radius}
%\synopsis{calculates the gravitational radius in Meters defined as r_g=GM/c^,
% for a mass given in units of M_sol.}
%\usage{gravitational_radius(mass_in_solar)}
%!%-
define gravitational_radius() {
variable mass_in_solar;
switch(_NARGS)
{ case 1: mass_in_solar = ();}
{ help(_function_name()); return; }
variable G = 6.673e-11;
variable c = 299792458.0;
variable Msol = 1.988e30; % in kg
return G*Msol*mass_in_solar / (c^2);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment