Skip to content

Commit 2aa3496

Browse files
authored
Merge pull request #1655 from CodingTrain/elastic-collisions
Add 184-elastic collisions challenge
2 parents ec687bd + ee43d14 commit 2aa3496

File tree

6 files changed

+97
-2
lines changed

6 files changed

+97
-2
lines changed

β€Žcontent/pages/challenges/index.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"title": "Challenges",
33
"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).",
44
"featuredText": "Featured Challenge:",
5-
"featuredChallenge": "64-kinematics"
5+
"featuredChallenge": "184-elastic-collisions"
66
}

β€Žcontent/pages/homepage/index.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"title": "Challenges",
3232
"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.",
3333
"featured": [
34-
"183-mathematical-marbling",
34+
"184-elastic-collisions",
3535
"64-kinematics",
3636
"125-fourier-series",
3737
"28-metaballs",
Loading
Loading
Loading
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
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

Comments
Β (0)