Coding Challenge #129: Koch Fractal Snowflake

Subscribers:
1,740,000
Published on ● Video Link: https://www.youtube.com/watch?v=X8bXDKqMsXE



Duration: 22:57
52,434 views
1,353


Snowflake Challenge #3! In this video, I draw the Koch Fractal Curve in Processing (Java). Code: https://thecodingtrain.com/challenges/129-koch-fractal-snowflake

πŸ•ΉοΈ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/SJHcVCAgN

πŸŽ₯ Previous video: https://youtu.be/pdaNttb7Mr8?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
πŸŽ₯ Next video: https://youtu.be/MY4luNgGfms?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
πŸŽ₯ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH

References:
πŸ’° Support the Processing Foundation: https://processingfoundation.org/support/
πŸ—„ Koch Snowflake: https://en.wikipedia.org/wiki/Koch_snowflake

Videos:
πŸŽ₯ Vectors: https://thecodingtrain.com/tracks/the-nature-of-code-2/noc/1-vectors/1-what-is-a-vector
πŸ”΄ Coding Train Live Holiday Telethon 2018: https://youtu.be/WACLmPBxMaw?t=11469s

Related Coding Challenges:
πŸš‚ #2 Menger Sponge Fractal: https://youtu.be/LG8ZK-rRkXo
πŸš‚ #14 Recursive Fractal Trees: https://youtu.be/0jjeOYMjmDU
πŸš‚ #21 Mandelbrot Set with p5.js: https://youtu.be/6z7GQewK-Ks
πŸš‚ #123 Chaos Game: https://youtu.be/7gNzMtYo9n4
πŸš‚ #126 Toothpicks: https://youtu.be/-OL_sw2MiYw
πŸš‚ #174 AppleSoft Basic Fractal Tree: https://youtu.be/UNkHditYGls

Timestamps:
0:00 Introducing today's topic
0:36 Koch curve algorithm
2:20 Create a Segment class
4:40 Add an array list of segments
5:10 Draw the segments
8:24 Divide segment by 3
0:00 Rotate to get the "hat"
12:50 Write a function to add the children to the segments
14:18 Use mousePressed() to get a new generation of segments
16:00 Why is the Koch curve called the "Monster Curve"?
19:11 Add a triangle
20:59 Conclusion and creative possibilities
21:47 Bonus addendum: use height of equilateral triangle to find 3rd point

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

#kochcurve #fractals #kochsnowflake #processing