Coding Challenge #129: Koch Fractal Snowflake
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