Skip to content

Simulate the mesmerizing dance of photons around a black hole! This Unity project visualizes gravitational light bending, photon trajectories, and the event horizon of a black hole using physics-inspired approximations.

License

Notifications You must be signed in to change notification settings

wendtpiotr/black-hole-photon-simulation

Repository files navigation

🌌 Black Hole Photon Simulator

Simulate the mesmerizing dance of photons around a black hole! This Unity project visualizes gravitational light bending, photon trajectories, and the event horizon of a black hole using physics-inspired approximations.

image
Recording.2025-10-27.171412.mp4

🔭 Features

  • 🌑 Black Hole Modeling

    • Schwarzschild black hole with configurable mass.
    • Event horizon visualization based on the Schwarzschild radius.
  • 💡 Photon Simulation

    • Track photons in 3D space around a black hole.
    • Tangential and radial velocities to mimic realistic light paths.
    • Newtonian-style approximation for gravitational light bending.
  • 📐 Physics Approximations

    • Schwarzschild metric-inspired motion.
    • Optional Paczyński–Wiita potential for pseudo-Newtonian black holes.
    • Light bending computed using a ~ 2*M/r² in geometric units.
  • 🎯 Interactive Visualization

    • Photon trajectories rendered as GameObjects.
    • Adjustable step sizes for numerical integration.
    • Explore photon capture, deflection, and escape.

🔬 Scientific Background

Schwarzschild Metric 🌑

The Schwarzschild solution describes spacetime around a non-rotating black hole:

[ r_s = \frac{2GM}{c^2} ]

  • ( r_s ) – Schwarzschild radius (event horizon)
  • ( M ) – Mass of the black hole
  • ( G ) – Gravitational constant
  • ( c ) – Speed of light

Inside ( r_s ), not even light can escape.

Paczyński–Wiita Potential 🌀

A pseudo-Newtonian approximation often used for simulations:

[ \Phi_{PW}(r) = -\frac{GM}{r - r_s} ]

  • Simplifies relativistic calculations while maintaining key black hole behaviors.

Photon Trajectories 💫

Photons follow curved paths due to spacetime curvature. Using the simulation:

  • Deflection: Light bends near the black hole, creating gravitational lensing effects.
  • Capture: Photons entering ( r_s ) are absorbed — visualized as disappearing trajectories.
  • Escape: Photons far from the black hole move mostly in straight lines.

About

Simulate the mesmerizing dance of photons around a black hole! This Unity project visualizes gravitational light bending, photon trajectories, and the event horizon of a black hole using physics-inspired approximations.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published