Coding Challenge #61: Fractal Spirograph

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



Duration: 44:19
75,636 views
1,559


In this coding challenge, I attempt to create a "Fractal Spirograph" with Processing (Java). The visuals are inspired by images and explanation on C. J. Chen’s blog. Code: https://thecodingtrain.com/challenges/61-fractal-spirograph

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

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

References:
πŸ–Š C.J.Chen's blog on Fractal Spirograph: http://benice-equation.blogspot.ca/2012/01/fractal-spirograph.html

Videos:
πŸŽ₯ My Video on Polar Coordinates: https://youtu.be/O5wjXoFrau4
πŸŽ₯ Live Stream #81: Fractal Spirograph: https://youtu.be/S5Qj-JgAN-M

Related Coding Challenges:
πŸš‚ #7 Solar System (2D): https://youtu.be/l8SiJ-RmeHU
πŸš‚ #55 Mathematical Rose Patterns: https://youtu.be/f5QBExMNB1I
πŸš‚ #116 Lissajous Curve Table: https://youtu.be/--6eyLO78CY

Timestamps:
0:00 Introduction
1:45 Benice equation
3:26 The solar system coding challenge
4:45 Polar to cartesian coordinates
5:53 Draw first circle
6:44 Add a second circle
8:54 Use polar coordinates to find radius of second circle
9:52 Increment the angle to rotate second circle around first circle
11:02 Save the points of the path of the second circle
14:07 Add an Orbit class
16:41 Linked lists
19:01 Write an addChild() function
23:20 Write a loop to add the next child
24:47 Write an update function
27:14 Add a speed variable
31:23 Trace the path
33:43 Get the formula
34:39 Have each orbit keep track of its level
35:27 Use the formula to calculate the speed
40:13 Bonus addendum with improvements
40:28 Adjust angle to have pattern point up
41:23 Adjust resolution
43:51 Thanks for watching!

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

#fractal #spirograph #polarcoordinates #processing #java







Tags:
live
programming
daniel shiffman
creative coding
coding challenge
tutorial
javascript
coding
challenges
coding train
the coding train
fractals
fractals spirograph
fractal art
fractal roulette
benice fractal
benice fractal spirograph
spirograph processing
spirograph java
fractals java
fractals processing
fractal processing
processing
processing java
java creative art
java creative coding
polar coordinates