BHLab
A real-time black hole simulator in one Python file: watch gravity bend light, throw stars into the hole, and even fly through the event horizon yourself.

What it does
BHLab is a 3D black hole simulator that runs in real time. The whole project is a single Python file, and all the heavy math runs on the GPU using the Taichi library. The black hole is not a drawing. For every pixel on the screen, the simulator shoots a ray of light and bends it with the same rule gravity uses. Rays that get too close never come back. And that is exactly what creates the black shadow, the thin ring of light around it, and the strangely twisted glowing disk. The disk's colors are real physics too. The gas coming toward you looks brighter and bluer, and the gas moving away looks dimmer and redder. It is also fun to play with. You can throw planets and stars at the hole and watch them slowly spiral in. You can build a black hole from a dying star, crash two black holes together, tear a giant star apart, or make the hole evaporate. You can load real black holes like M87*, with their true mass and spin. And at the end, you can dive inside, while an info box explains the physics on screen, with the real equations.