|
| 1 | +{ |
| 2 | + "title": "Elastic Collisions", |
| 3 | + "videoNumber": "184", |
| 4 | + "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.", |
| 5 | + "videoId": "dJNFPv9Mj-Y", |
| 6 | + "nebulaSlug": "codingtrain-coding-challenge-184-elastic-collisions", |
| 7 | + "date": "2024-07-12", |
| 8 | + "languages": ["p5.js", "JavaScript"], |
| 9 | + "topics": ["collisions", "physics simulation"], |
| 10 | + "canContribute": true, |
| 11 | + "relatedChallenges": ["67-pong", "98-quadtree", "139-calculating-digits-of-pi-with-collisions", "176-buffon-needle"], |
| 12 | + "timestamps": [ |
| 13 | + { "time": "0:00", "title": "Introduction" }, |
| 14 | + { "time": "0:20", "title": "The Nature of Code book" }, |
| 15 | + { "time": "1:22", "title": "Review background material" }, |
| 16 | + { "time": "4:15", "title": "Collision Resolution" }, |
| 17 | + { "time": "5:42", "title": "Start Coding" }, |
| 18 | + { "time": "8:48", "title": "Add collide() function" }, |
| 19 | + { "time": "10:17", "title": "Momentum and kinetic energy" }, |
| 20 | + { "time": "14:15", "title": "Line of impact" }, |
| 21 | + { "time": "16:44", "title": "Add the formulas" }, |
| 22 | + { "time": "21:25", "title": "Simplify the code" }, |
| 23 | + { "time": "22:57", "title": "Check for overlap" }, |
| 24 | + { "time": "24:31", "title": "Check the particle's kinetic enery" }, |
| 25 | + { "time": "25:48", "title": "Fix error" }, |
| 26 | + { "time": "27:30", "title": "Add more particles" }, |
| 27 | + { "time": "30:11", "title": "Optimizations" }, |
| 28 | + { "time": "30:50", "title": "Outro" } |
| 29 | + ], |
| 30 | + "codeExamples": [ |
| 31 | + { |
| 32 | + "title": "Elastic Collisions", |
| 33 | + "description": "Implementation of elastic collisions", |
| 34 | + "image": "img1.jpg", |
| 35 | + "urls": { |
| 36 | + "p5": "https://editor.p5js.org/codingtrain/sketches/3DrBb8LCp" |
| 37 | + } |
| 38 | + }, |
| 39 | + { |
| 40 | + "title": "Elastic Collisions - Quadtree", |
| 41 | + "description": "Optimization with quadtree algorithm", |
| 42 | + "image": "img2.jpg", |
| 43 | + "urls": { |
| 44 | + "p5": "https://editor.p5js.org/codingtrain/sketches/z8n19RFz9" |
| 45 | + } |
| 46 | + } |
| 47 | + ], |
| 48 | + "groupLinks": [ |
| 49 | + { |
| 50 | + "title": "References", |
| 51 | + "links": [ |
| 52 | + { |
| 53 | + "icon": "π", |
| 54 | + "title": "The Nature of Code", |
| 55 | + "url": "https://natureofcode.com/", |
| 56 | + "description": "The Nature of Code book (2024 p5.js edition)" |
| 57 | + }, |
| 58 | + { |
| 59 | + "icon": "π", |
| 60 | + "title": "Pre-order The Nature of Code", |
| 61 | + "url": "https://nostarch.com/nature-code", |
| 62 | + "description": "The Nature of Code book (2024 p5.js edition) is now available for pre-order!" |
| 63 | + }, |
| 64 | + { |
| 65 | + "icon": "π", |
| 66 | + "title": "Elastic Collision", |
| 67 | + "url": "https://en.wikipedia.org/wiki/Elastic_collision", |
| 68 | + "description": "Wikipedia article discussing elastic collisions." |
| 69 | + }, |
| 70 | + { |
| 71 | + "icon": "π", |
| 72 | + "title": "2-Dimensional Elastic Collisions without Trigonometry", |
| 73 | + "url": "https://www.vobarian.com/collisions/2dcollisions2.pdf", |
| 74 | + "description": "Introduction to solving collisions without complicated trigonometry." |
| 75 | + }, |
| 76 | + { |
| 77 | + "icon": "π", |
| 78 | + "title": "Elastic Collisions Formula Derivation", |
| 79 | + "url": "https://dipamsen.github.io/notebook/collisions.pdf", |
| 80 | + "description": "Explanation and derivation for formula of elastic collisions, by Dipam Sen." |
| 81 | + } |
| 82 | + ] |
| 83 | + } |
| 84 | + ], |
| 85 | + "credits": [ |
| 86 | + { |
| 87 | + "title": "Editing", |
| 88 | + "name": "Mathieu Blanchette" |
| 89 | + }, |
| 90 | + { |
| 91 | + "title": "Animations", |
| 92 | + "name": "Jason Heglund" |
| 93 | + } |
| 94 | + ] |
| 95 | +} |
0 commit comments