Coding Challenge #133: Times Tables Cardioid Visualization

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



Duration: 17:21
84,032 views
2,845


In this video, I visualize the "mathematical heart" Cardioid using times tables calculations. Code: https://thecodingtrain.com/challenges/133-time-tables-cardioid-visualization

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

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

References:
πŸ—„ Cardioid on Wikipedia: https://en.wikipedia.org/wiki/Cardioid
πŸ“ Rainbow Topics suggestion from Eduardddd: https://github.com/CodingTrain/Rainbow-Topics/issues/1036

Videos:
πŸŽ₯ Times Tables, Mandelbrot and the Heart of Mathematics: https://youtu.be/qhbuKbxJsk8
πŸŽ₯ Times Tables Visualization Poster in Processing: https://youtu.be/I-b54QkD3so
πŸŽ₯ Polar Coordinates: https://youtu.be/O5wjXoFrau4
πŸŽ₯ The Modulo Operator: https://www.youtube.com/watch?v=r5Iy3v1co0A
πŸ”΄ Coding Train Live 168: https://youtu.be/_xa87yl0nd4?t=2077s

Related Coding Challenges:
πŸš‚ #21 Mandelbrot Set with p5.js: https://youtu.be/6z7GQewK-Ks
πŸš‚ #116 Lissajous Curve Table: https://youtu.be/--6eyLO78CY
πŸš‚ #134 Heart Curve: https://youtu.be/oUBAi9xQ2X4
πŸš‚ #163 BΓ©zier Curves: https://youtu.be/enNfb6p3j_g

Timestamps:
0:00 Introduction
1:00 Simon Tiger's Processing Day presentation
2:07 Discussion of the times tables calculations
4:03 Start Coding!
5:34 Map the point's index to an angle
6:08 Use polar coordinates to get point location
6:31 Draw the points
7;48 Start with the 2-times table
8:37 Write a getVector() function
11:00 Use modulo operator to get remainder for mapping
12:28 Add PI to rotate the cardioid 180 degrees
13:31 Animate by mapping mouseX to the total number of points
14:34 Change to 3-times table
16:19 Animate by changing the factor
16:43 Conclusion and creative possibilities

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

#cardioid #cardioidtimestables #timestablesvisualization #heartalgorithm #polarcoordinates #modulooperator #processing







Tags:
daniel shiffman
coding
the coding train
coding challenge
creative coding
code challenge
javascript (programming language)
programming challenge
cardioid
cardioid times tables
times tables visualization
cardioid visualization
heart algorithm
cardioid processing
cardioid java
computer science
processing
processing(java)
times tables
multiplication table
valentine's day
heart visualization
source code heart