Coding Challenge 144: 2D Black Hole Visualization

The Coding Train
The Coding Train
231.5 هزار بار بازدید - 5 سال پیش - Inspired by the recent image
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...

p5.js Web Editor Sketches:
🕹️ Black Hole Visualization - Newtonian Granvitational Attraction: https://editor.p5js.org/codingtrain/s...
🕹️ Black Hole Visualization - Code with Relativistic Corrections: https://editor.p5js.org/codingtrain/s...

🎥 Previous video: Coding Challenge #143: Quicksort Visu...
🎥 Next video: Coding Challenge #145: 2D Raycasting
🎥 All videos: Coding Challenges

References:
📓 Simulating a Black Hole!: https://www.asc.ohio-state.edu/orban....
🖌 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/cg...

Videos:
🎥 How to Understand the Image of a Black Hole: How to Understand What Black Holes Lo...
🎥 Slingshot with Gravity!: Slingshot with Gravity! (challenge)
🔴 Coding Train Live 176: Coding Train Live 176: Simple 2D Blac...

Related Coding Challenges:
🚂 #7 Solar System (2D): Coding Challenge #7: Solar System in ...
🚂 #8 Solar System (3D): Coding Challenge #8: Solar System in ...

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/pas...
🚩 Suggest Topics: https://github.com/CodingTrain/Sugges...
💡 GitHub: https://github.com/CodingTrain
💬 Discord: https://thecodingtrain.com/discord
💖 Membership: http://youtube.com/thecodingtrain/join
🛒 Store: https://standard.tv/codingtrain
🖋️ Twitter: Twitter: thecodingtrain
📸 Instagram: Instagram: the.coding.train

🎥 Coding Challenges: Coding Challenges
🎥 Intro to Programming: Start learning here!

🔗 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-o...

This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecod...

#blackholevisualization #eventhorizon #accretiondisk #javascript #p5js
5 سال پیش در تاریخ 1398/02/06 منتشر شده است.
231,534 بـار بازدید شده
... بیشتر