Created
May 14, 2018 12:25
-
-
Save mr21/a0f06364f84bd3c756d4e989d1f4a591 to your computer and use it in GitHub Desktop.
Function to calcul the Schwarzschild radius with a mass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const lightSpeed = 299792458; // meter (per second) | |
const solarMass = 1.98855 * Math.pow( 10, 30 ); // kilograms | |
const gravity = 6.67408 * Math.pow( 10, -11 ); | |
function calcSchwarzschildRadius( nbSolarMass ) { | |
return ( 2 * gravity * nbSolarMass * solarMass ) / ( lightSpeed * lightSpeed ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment