简体   繁体   English

如何计算从另一个静态圆弹起的圆的速度方向?

[英]How do you calculate direction of velocity of a circle bouncing off another static circle?

I've got code for two moving circles to bounce off each other properly, but when applying the same code for the situation where one of the two moving circles is static and does not move, the moving circle seems to orbit the static one. 我有两个运动圆的代码可以正确地相互弹回,但是当两个运动圆之一是静态且不运动的情况下应用相同的代码时,运动圆似乎绕着静态的一转。 How can I fix this? 我怎样才能解决这个问题?

如果您有从墙弹起的圆的代码,则可以通过在圆之间的接触点找到与静态圆相切的线并假装沿该线延伸的墙反弹的运动圆来近似它。

The article 2-Dimensional Elastic Collisions offers a vector approach to the problem. 二维弹性碰撞一文提供了解决该问题的矢量方法。 In particular, "The tangential components of the velocities are not changed by the collision because there is no force along the line tangent to the collision surface. The normal components of the velocities undergo a one-dimensional collision," which conserves momentum and kinetic energy. 特别是,“速度的切向分量不会因碰撞而改变,因为沿切线的直线没有与碰撞表面相切的力。速度的法向分量会发生一维碰撞,”这可以节省动量和动能。 There's a Java implementation here . 有一个Java实现这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM