MENU

Fun & Interesting

Coding Challenge #21: Mandelbrot Set with p5.js

The Coding Train 378,658 9 years ago
Video Not Working? Fix It Now

In this coding challenge, I program from scratch the Mandelbrot set with p5.js Code: https://thecodingtrain.com/challenges/21-mandelbrot-set-with-p5js ๐Ÿ•น๏ธ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/KsV1wWLqd ๐ŸŽฅ Previous video: https://youtu.be/jrk_lOg_pVA?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH ๐ŸŽฅ Next video: https://youtu.be/fAsaSkmbF5s?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH ๐ŸŽฅ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH References: ๐Ÿ—„ Wikipedia on Mandelbrot Set: https://en.wikipedia.org/wiki/Mandelbrot_set ๐Ÿ’พ Mandelbrot Set Explorer: https://meiamso.me/old/mandelbrot/mandelbrot.php Related Coding Challenges: ๐Ÿš‚ #22 Julia Set in Processing: https://youtu.be/fAsaSkmbF5s ๐Ÿš‚ #140 Leibniz Formula for Pi: https://youtu.be/uH4trBNn540 ๐Ÿš‚ #168 The Mandelbulb: https://youtu.be/NJCiUVGiNyA Timestamps: 0:00 Introducing today's coding challenge: the Mandelbrot set 1:22 What is a complex number? 6:06 Multiplying two complex numbers 7:51 The Mandelbrot set is all of the complex numbers that stay bounded 8:40 The initial sketch sets every pixel to gray 12:00 Calculate the real and complex components for the next generation 13:03 What does it mean to be bounded? 14:58 Set the brightness based on number of iterations 16:46 Store the original values of a and b 20:05 Set the brightness by mapping to maxIterations 21:50 Add sliders to add ability to zoom in on the Mandelbrot set 24:58 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://discord.gg/hPuGy2g ๐Ÿ’– 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 #mandelbrot #fractal #complexnumber #imaginarynumber #p5js #javascript

Comment