News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

Physics in collisions.

Started by ScottieB, February 13, 2014, 04:52:30 PM

Previous topic - Next topic

ScottieB

Below is a formula I came up with for elastic collisions.
I'm not using the momentum formula you can find on the net.
Instead I just did some simple math to try in come up with something that looks right.
Of course the final velocities will have to be in opposite directions.
Can you have a look at it and tell me what you think?
I don't think the masses will change of course unless they cars they would crash.
The speeds seem to adjust accordingly.

Thanks
ScottieB

*****************

Mass_1 = 5
Mass_2 = 2

Vel_1 = 2
Vel_2 = 3

Combined_Velocities = Vel_1 + Vel_2 = 5

Force_1 = Mass_1 * Vel_1 = 10
Force_2 = Mass_2 * Vel_2 = 6

Combined_Forces = Force_1 + Force_2 = 16

Percentage_1 = Force_1 / Combined_Forces = 0.625
Percentage_2 = Force_2 / Combined_Forces = 0.375

New_Vel_1 = Percentage_1 * Combined_Velocities = 3.125
New_Vel_2 = Percentage_2 * Combined_Velocities = 1.875

If Force_1 > Force_2 Then Vel_1 = New_Vel_2:Vel_2 = New_Vel_1
If Force_2 > Force_1 Then Vel_2 = New_Vel_2:Vel_1 = New_Vel_1

******************

monkeybot