Skip to content

Instantly share code, notes, and snippets.

@mcsee
Created June 9, 2024 19:40
Show Gist options
  • Save mcsee/6eea7c69dd11e4337e1819e4a3682475 to your computer and use it in GitHub Desktop.
Save mcsee/6eea7c69dd11e4337e1819e4a3682475 to your computer and use it in GitHub Desktop.
Gemini Black Hole
public class BlackHole
{
public double Mass { get; private set; }
public double SchwarzschildRadius { get; private set; }
public bool HasSingularity { get; } // Always true for a black hole
public BlackHole(double mass)
{
Mass = mass;
SchwarzschildRadius = CalculateSchwarzschildRadius(mass);
HasSingularity = true;
}
private double CalculateSchwarzschildRadius(double mass)
{
const double G = 6.6743e-11; // Gravitational constant
return 2 * G * mass / Constants.SpeedOfLight;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment