math - Resolving a Circle-Circle Collision -


i writing software extends circle-rectangle collision detection (intersection) include responses collision. circle-edge , circle-rectangle rather straight-forward. circle-circle has me stumped.

for example, let 2 circles collide, 1 red , 1 green, in discrete event simulation. might have following situation:

two circles colliding

immediately after collide have:

enlarged circles collision

here rip , gip locations of circles @ previous clock tick. @ current clock tick, collision detected @ rdp , gdp. however, collision occurred between clock ticks when 2 circles @ rcp , gcp. @ clock tick, red circle moves rvy downward , rvx rightward; green circle moves gvy downward , gvx leftward. rvy not equal gvy; nor rvx equal gvx.

circle-circle computation

the collision occurs when distance between circle centers less or equal sum of circles' radii, is, in preceding figure, d <= ( rr + gr ). @ collision d < ( rr + gr ), need position dps cps before adjusting circles' velocity components. in case of d == ( rr + gr ), no repositioning required since dps @ cps.

this problem: how make move cps. authors have suggested one-half of penetration, given p in following figure, applied.

penetration

to me plain wrong. assumes velocity vectors of 2 circles equal that, in example, not case. think penetration has computation how eludes me. know problem can recast problem of right similar triangles in want solve gcdy , gcdx.

right similar triangles

the collision modeled elastic, , math exchange of inertia in place. issue position circles @ collision.

if you're looking basic reference on inelastic collisions circular objects, pool hall lessons: fast, accurate collision detection between circles or spheres joe van den heuvel , miles jackson easy follow.

from least formal formal, here follow references on craft of implementing programming underpins solution question (collision responses).

you're going have accept approximations - beckman demonstrates in video simple cases, isn't possible analytically predict occur, worse because simulating continuous system discrete steps.


Comments

Popular posts from this blog

Line ending issue with Mercurial or Visual Studio -

java - Jtable duplicate Rows -

java - Run a .jar on Heroku -