两个二维圆之间的碰撞响应
我正在尝试编写一个模拟程序,其中两个圆将发生碰撞,然后在弹性碰撞中弹开。每个圆都有位置、速度、质量和半径。我已经完成了碰撞检测,但我不知道如何确保生成的速度是真实的。
我知道作用在每个物体上的力是相同的,并且已经计算出合力的角度,但我需要找到力的大小。给定速度和速度,如何解决
我使用力的速度,因为它非常适合程序的其余部分,如果有更简单的方法,请告诉我。
I am trying to write a sim in which two circles will collide and then bounce apart in an elastic collision. Each circle has a position, velocity, mass, and radius. I already have the collision detection worked out, but I do not know how to ensure that the resulting velocities are realistic.
I know that the forces acting on each would be the same, and have already worked out the angle of the resulting forces, but I need to find the magnitude of the forces. Given the speed and velocity, how would one solve for the speed
I am using forces because it fits in well to the rest of the program, if there is an easier way please let me know.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先,弄清楚球如何从任意角度的墙上反弹。如果 v 是速度矢量,a 是法线(垂直于壁并指向壁外的单位矢量),则 v' = v - 2 (v .a) a 给出弹跳后的速度。
其次,考虑两个动量相等但方向相反的球的碰撞,就像两个速度相等但方向相反的相同球相互擦过一样。每个球都会表现得好像撞到了一堵墙,即与两个球相切的线。
第三,为了处理一般情况,我们使用质量框架中心。质心速度为:
vCM = (mAvA + mBvB)/(mA+mB )
这是观察者的速度,在观察者看来,两个球似乎具有相等且相反的动量。该观察者坐标系中的速度为:
vA' = vA - v CM
vB' = vB - vCM >
现在我们使用上面的解决方案(“第二个”)来查找碰撞后的速度,vA'' 和 vB''(仍在 CM 框架中)。最后我们回到原始框架:
vA''' = vA'' + vCM
vB''' = vB'' + vCM
First, figure out how a ball bounces off a wall that has an arbitrary angle. If v is the velocity vector and a is the normal (unit vector perpendicular to the wall and pointing out of it), then v' = v - 2 (v . a) a gives you the velocity after the bounce.
Second, consider the collision of two balls of equal but opposite momenta, like two identical balls with equal but opposite velocities, glancing off each other. Each ball will act as if it struck a wall, namely the line tangent to both balls.
Third, to deal with the general case, we use the Center of Mass Frame. The velocity of the center of mass is:
vCM = (mAvA + mBvB)/(mA+mB)
This is the velocity of an observer to whom the two balls seem to have equal and opposite momenta. The velocities in that observer's frame are:
vA' = vA - vCM
vB' = vB - vCM
Now we use the solution above ("second") to find the velocities after the collision, vA'' and vB'' (still in the CM frame). Finally we shift back into the original frame:
vA''' = vA'' + vCM
vB''' = vB'' + vCM
利用动量守恒定律和能量守恒定律。您必须为每个圆假设一些虚构的质量,这样您就可以求解碰撞后产生的速度。
设 m1 和 m2 分别为圆 c1 和 c2 的质量,速度为 v1 和 v2。那么,
m1.v1 + m2.v2(碰撞前)= m1.v1 + m2.v2(碰撞后)(动量的缺点)
上面的eqn是一个向量方程。
应用能量守恒定律:势能+动能(碰撞前)=罐能+基恩能(碰撞后)
Use the laws of conservation of momentum and conservation of energy. You will have to assume some fictional masses for each circle as with that will allow you to solve for the resulting velocities after the collision.
Let m1 and m2 be the masses of circle c1 and c2 respectively, with velocities v1 and v2. then ,
m1.v1 + m2.v2 ( before collision ) = m1.v1 + m2.v2 ( after collision ) ( cons. of momentum )
Above eqn is a vector equation.
Apply Conservation of energy : Potential Ener + Kinetic Ener ( before col ) = Pot Ener + Kien Energy ( after collision)