Mi

Minimalistic collisions simulation using TypeScript and HTML Canvas

Hacker News

Minimalistic collisions simulation using TypeScript and HTML Canvas

Hey HN, @atan2 submitted a great post 4 days ago about 2D rigid body collisions ( https://news.ycombinator.com/item?id=40463764 ). For what it's worth, here is a minimalistic simulation that I coded last year using TypeScript and HTML Canvas: - Code: https://github.com/vandrieu/canvas-bouncing-ball - Demo/Result: https://vandrieu.github.io/canvas-bouncing-ball The main challenge was how to determine the angle and speed of each ball after a collision at a given angle. I found the relevant theoretical material in the 2009 paper titled "2-Dimensional Elastic Collisions without Trigonometry" by Chad Berchek: https://www.vobarian.com/collisions/2dcollisions2.pdf Please feel free to copy and use the code any way you wish.

Share card

Actual performance

2points
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Product HuntOn track for Day 1 leaderboard · Strong signals: new, using, code · Missing: mac, agents, macos
66%66% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Hacker NewsStrong engagement from HN community · Strong signals: io · Missing: https docs, excited, just released
59%59% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
39%39% predicted probability of success on AppSumo, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Strong signals: way · Missing: mobile apps, ios, personal
38%38% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Indie HackersIH features products with proven revenue · Missing: supports, reddit linkedin, podcasting
35%35% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
13%13% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
4%4% predicted probability of success on BetaList, based on ML models trained on real launch data.

Incorrect prediction on native model

Similar products

We
WebGPU + TypeScript Slime Mold Simulation62%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

WebGPU + TypeScript Slime Mold Simulation

Hacker News1
ss
ssr-sample – a sample of SSR and SPA using typescript30%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

ssr-sample – a sample of SSR and SPA using typescript

Hacker News1
Ty
TypeScript implementation of X3DH using Libsodium36%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

TypeScript implementation of X3DH using Libsodium

Hacker News1
A
A simulation of the WWV/WWVH broadcast using python3 and SoX and espeak52%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

A simulation of the WWV/WWVH broadcast using python3 and SoX and espeak

Hacker News2
Le
Lemmings in HTML in Canvas38%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Lemmings in HTML in Canvas

Hacker News2
Bo
Boids in HTML canvas55%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Boids in HTML canvas

Hacker News4
Us
Using Unicode in HTML44%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Using Unicode in HTML

Hacker News2
An
An interactive n-body simulation using the Canvas API66%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

An interactive n-body simulation using the Canvas API

Hacker News1
Te
Teen Patti game simulation using clojure57%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Teen Patti game simulation using clojure

Hacker News1
Du
DuoCode 1.0 bridges the gap between C# and TypeScript31%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

DuoCode 1.0 bridges the gap between C# and TypeScript

Hacker News7