New velocity after circle collision

余生长醉 提交于 2019-11-30 23:08:46

Assuming you're making some simple (game-like) billiards simulation you could use something like:

v_new = coeff*(v_old - 2*dot(v_old, boundary_normal)*boundary_normal);

Here v_old is your current velocity vector and boundary_normal is the inward pointing normal of your circular billiards table at the point of impact. If you know the center c of your circular table and you have the point of impact p then the normal is simply normalize(c-p). That is, the normalized vector you obtain when subtracting p from c.

Now I have taken coeff to be a fudge factor between 0 (no velocity at all anymore after impact) and 1 (same velocity after impact). You can make this more physically plausible by determining a correct coefficient of restitution.

In the end all the formula above is, is simple reflection as you might have seen in a basic ray tracer for example. As said, it's a fairly crude abstraction from an accurate physics simulation, but will most likely do the job.

As the comments say, this is a mechanics question. Have a look at the momentum definition. What you want in particular, is covered in the section elastic collisions.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!