Inspired by the recent image of the Powehi m87 black hole from the Event Horizon Telescope, I visualize the behavior or light (photons) following the path of spacetime around the black hole in p5.js. Code: https://thecodingtrain.com/challenges/144-2d-black-hole-visualization
p5.js Web Editor Sketches:
🕹️ Black Hole Visualization - Newtonian Granvitational Attraction: https://editor.p5js.org/codingtrain/sketches/2zZqSkxtj
🕹️ Black Hole Visualization - Code with Relativistic Corrections: https://editor.p5js.org/codingtrain/sketches/4DvaeH0Ur
🎥 Previous video:
https://youtu.be/eqo2LxRADhU?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
🎥 Next video:
https://youtu.be/TOEi6T2mtHo?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
🎥 All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
References:
📓 Simulating a Black Hole!: https://www.asc.ohio-state.edu/orban.14/stemcoding/blackhole.html
🖌 How to draw a Black Hole: http://rantonels.github.io/starless/
📰 Astronomers Capture First Image of a Black Hole: https://eventhorizontelescope.org/
📓 Image of a Spherical Black Hole with Thin Accretion Disk: http://articles.adsabs.harvard.edu/cgi-bin/nph-iarticle_query?1979A&A....75..228L
Videos:
🎥 How to Understand the Image of a Black Hole:
https://youtu.be/zUyH3XhpLTo
🎥 Slingshot with Gravity!:
https://youtu.be/RkpulcVKLRw
🔴 Coding Train Live 176:
https://youtu.be/tWyp2OWWcws?t=1192s
Related Coding Challenges:
🚂 #7 Solar System (2D):
https://youtu.be/l8SiJ-RmeHU
🚂 #8 Solar System (3D):
https://youtu.be/dncudkelNxw
Timestamps:
0:00 Introducing today's topic: a black hole visualization
3:25 The elements in the black hole visualization
5:06 The event horizon
6:35 The accretion disk
8:35 What happens when light is traveling towards a black hole?
9:43 The theory of relativity
12:03 Let's Code!
13:52 Make a black hole object
16:57 Draw the accretion disk
18:49 Draw an unstable photon orbit
20:22 Create a photon class
23:25 Add velocity to the photons
25:46 Apply Newtonian gravitational attraction
31:36 Add a trail to the photon
38:17 Corrections to the code
40:14 Add the angle of velocity for the photon
0:00 Conclusion and suggestions for variations
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
🚂 Website: http://thecodingtrain.com/
👾 Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide
🚩 Suggest Topics: https://github.com/CodingTrain/Suggestion-Box
💡 GitHub: https://github.com/CodingTrain
💬 Discord: https://thecodingtrain.com/discord
💖 Membership: http://youtube.com/thecodingtrain/join
🛒 Store: https://standard.tv/codingtrain
🖋️ Twitter: https://twitter.com/thecodingtrain
📸 Instagram: https://www.instagram.com/the.coding.train/
🎥 Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
🎥 Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
🔗 p5.js: https://p5js.org
🔗 p5.js Web Editor: https://editor.p5js.org/
🔗 Processing: https://processing.org
📄 Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct
This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new
#blackholevisualization #eventhorizon #accretiondisk #javascript #p5js