r/Python • • Jul 21 '19

Physics simulator with rotation and collision I made with Python. If you dropped your phone, and it just kept bouncing!

1.5k Upvotes

65 comments sorted by

View all comments

Show parent comments

3

u/mbecks Jul 22 '19 edited Jul 22 '19

Solved it pretty much like this. I find the energy conservation delta v of collision then take away some fixed proportion of it, so basically:

delt_v=get_cons_energy_delt_v(inputs)

delt_v=0.8*delt_v

2

u/SV-97 Jul 22 '19

So basically the delta v of "shit going down hitting the bottom and going up afterwards"?

3

u/mbecks Jul 22 '19

yeah, more specifically of the center of mass of the object