diff --git a/content/pages/challenges/index.json b/content/pages/challenges/index.json index 72bb111ef..b9c63bb0f 100644 --- a/content/pages/challenges/index.json +++ b/content/pages/challenges/index.json @@ -2,5 +2,5 @@ "title": "Challenges", "description": "Ready to apply what you’ve learned in the Tracks? Try a Challenge! These one-off project videos build off concepts introduced in Tracks and may have prerequisites (listed on the challenge page itself).", "featuredText": "Featured Challenge:", - "featuredChallenge": "64-kinematics" + "featuredChallenge": "184-elastic-collisions" } diff --git a/content/pages/homepage/index.json b/content/pages/homepage/index.json index 0af24bba9..8b7769c47 100644 --- a/content/pages/homepage/index.json +++ b/content/pages/homepage/index.json @@ -31,7 +31,7 @@ "title": "Challenges", "description": "Watch Dan take on Coding Challenges in p5.js and Processing. The challenge topics include algorithmic art, machine learning, simulation, generative poetry, and more.", "featured": [ - "183-mathematical-marbling", + "184-elastic-collisions", "64-kinematics", "125-fourier-series", "28-metaballs", diff --git a/content/videos/challenges/184-elastic-collisions/images/img1.jpg b/content/videos/challenges/184-elastic-collisions/images/img1.jpg new file mode 100644 index 000000000..f092e7a14 Binary files /dev/null and b/content/videos/challenges/184-elastic-collisions/images/img1.jpg differ diff --git a/content/videos/challenges/184-elastic-collisions/images/img2.jpg b/content/videos/challenges/184-elastic-collisions/images/img2.jpg new file mode 100644 index 000000000..6d192239f Binary files /dev/null and b/content/videos/challenges/184-elastic-collisions/images/img2.jpg differ diff --git a/content/videos/challenges/184-elastic-collisions/index.jpg b/content/videos/challenges/184-elastic-collisions/index.jpg new file mode 100644 index 000000000..7d0ff9698 Binary files /dev/null and b/content/videos/challenges/184-elastic-collisions/index.jpg differ diff --git a/content/videos/challenges/184-elastic-collisions/index.json b/content/videos/challenges/184-elastic-collisions/index.json new file mode 100644 index 000000000..c6d02255a --- /dev/null +++ b/content/videos/challenges/184-elastic-collisions/index.json @@ -0,0 +1,95 @@ +{ + "title": "Elastic Collisions", + "videoNumber": "184", + "description": "What happens when two circles collide in a p5.js canvas? In this video, I examine the math and implement idealized elastic collisions in a physics simulation. This video supplements the Nature of Code book series in Chapter 6 which uses 3rd party physics libraries to handle collisions rather than a direct implementation.", + "videoId": "dJNFPv9Mj-Y", + "nebulaSlug": "codingtrain-coding-challenge-184-elastic-collisions", + "date": "2024-07-12", + "languages": ["p5.js", "JavaScript"], + "topics": ["collisions", "physics simulation"], + "canContribute": true, + "relatedChallenges": ["67-pong", "98-quadtree", "139-calculating-digits-of-pi-with-collisions", "176-buffon-needle"], + "timestamps": [ + { "time": "0:00", "title": "Introduction" }, + { "time": "0:20", "title": "The Nature of Code book" }, + { "time": "1:22", "title": "Review background material" }, + { "time": "4:15", "title": "Collision Resolution" }, + { "time": "5:42", "title": "Start Coding" }, + { "time": "8:48", "title": "Add collide() function" }, + { "time": "10:17", "title": "Momentum and kinetic energy" }, + { "time": "14:15", "title": "Line of impact" }, + { "time": "16:44", "title": "Add the formulas" }, + { "time": "21:25", "title": "Simplify the code" }, + { "time": "22:57", "title": "Check for overlap" }, + { "time": "24:31", "title": "Check the particle's kinetic enery" }, + { "time": "25:48", "title": "Fix error" }, + { "time": "27:30", "title": "Add more particles" }, + { "time": "30:11", "title": "Optimizations" }, + { "time": "30:50", "title": "Outro" } + ], + "codeExamples": [ + { + "title": "Elastic Collisions", + "description": "Implementation of elastic collisions", + "image": "img1.jpg", + "urls": { + "p5": "https://editor.p5js.org/codingtrain/sketches/3DrBb8LCp" + } + }, + { + "title": "Elastic Collisions - Quadtree", + "description": "Optimization with quadtree algorithm", + "image": "img2.jpg", + "urls": { + "p5": "https://editor.p5js.org/codingtrain/sketches/z8n19RFz9" + } + } + ], + "groupLinks": [ + { + "title": "References", + "links": [ + { + "icon": "📕", + "title": "The Nature of Code", + "url": "https://natureofcode.com/", + "description": "The Nature of Code book (2024 p5.js edition)" + }, + { + "icon": "🛒", + "title": "Pre-order The Nature of Code", + "url": "https://nostarch.com/nature-code", + "description": "The Nature of Code book (2024 p5.js edition) is now available for pre-order!" + }, + { + "icon": "🔗", + "title": "Elastic Collision", + "url": "https://en.wikipedia.org/wiki/Elastic_collision", + "description": "Wikipedia article discussing elastic collisions." + }, + { + "icon": "📃", + "title": "2-Dimensional Elastic Collisions without Trigonometry", + "url": "https://www.vobarian.com/collisions/2dcollisions2.pdf", + "description": "Introduction to solving collisions without complicated trigonometry." + }, + { + "icon": "📃", + "title": "Elastic Collisions Formula Derivation", + "url": "https://dipamsen.github.io/notebook/collisions.pdf", + "description": "Explanation and derivation for formula of elastic collisions, by Dipam Sen." + } + ] + } + ], + "credits": [ + { + "title": "Editing", + "name": "Mathieu Blanchette" + }, + { + "title": "Animations", + "name": "Jason Heglund" + } + ] +}