JavaSCript/HTML5 Equatorial Black Hole Simulator

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
4 replies · 4K views
m4r35n357
Messages
657
Reaction score
148
Not to be confused with the full 3/4D one that I was plugging a while ago . . . this HTML5 canvas/JavaScript page was inspired by an old visual aid (requires Java plugin) that I found lacking in several areas. The improvements that I have made include:
  • Handles spinning black holes, with prograde and retrograde particle motion
  • Quantitatively accurate results to the best of my knowledge
  • More configurable and interactive than the applet
  • Side by side comparison with Newtonian gravity (as far as possible)
The default configuration is an approximation to Mercury's orbit around the Sun. Precession is virtually undetectable on human timescales, but you can transport the planet closer to the sun to see relativistic effects come into play. Needs 1920x1080.

Thread marked as intermediate for those who want to study the code, but should be usable by anyone . . . Enjoy!
 
Last edited:
  • Like
Likes   Reactions: Markus Hanke, Greg Bernhardt and Borg
Physics news on Phys.org
Thanks for posting. I will have to look at the code later for ideas. :smile:
 
Borg said:
Thanks for posting. I will have to look at the code later for ideas. :smile:
Here is the GitHub link if you want to do this. The code is not what I'd call pretty, but it is slightly encapsulated, and runs in "strict" mode ;)
 
  • Like
Likes   Reactions: Borg
Thanks for the direct link. I saw that it was probably on github based on the URL. I'm always looking for new and interesting visualizations in Java and Javascript. Now, all I need is the time to look it over.
 
[Updated: Cleaned up UI a bit, added dual speed displays and JS console debug toggle]

This HTML5 canvas/JavaScript page was inspired by an old visual aid (requires Java plugin) that I found lacking in several areas. The improvements that I have made include:
  • Handles spinning black holes, with prograde and retrograde particle motion
  • Quantitatively accurate results to the best of my knowledge
  • Side by side comparison with Newtonian gravity (as far as possible)
  • Single page interface, keyboard operable
The default configuration is an approximation to Mercury's orbit around the Sun. Precession is virtually undetectable on human timescales, but you can transport the planet closer to the sun to see relativistic effects come into play. Needs 1920x1080.

GitHub