I started coding a physics program that simulates gravity - specifically a bouncing ball - and I've already learned a lot researching the topic but the bounce still doesn't look quite right. I need a simple formula that captures a bounce. There may be questions similar to this, but I wanted advice on whether the following logic makes sense. I'm also not very math or physics-savvy, so if you can explain it in a way that a law student would understand or link me to some appropriate material, I'd appreciate it a lot.
So far I have something like this:
The downward fall from a stationary position:
Velocity (going down) = 0.5 * 9.8 * time^2 Where time = seconds counting up.
Velocity (going up) = Coefficient of Restitution * Velocity Just Before Bounce
I reversed the first formula so that the ball is essentially "rewinding time", so to speak.
Velocity (going up) = Coefficient of Restitution * 0.5 * 9.8 * time^2 Where time = seconds counting down from wherever the "counting up" stopped, so that the velocity decreases to zero at the same rate that it increased during free fall.
Velocity (going down) = 0.5 * 9.8 * time^2 Where time = seconds counting up before the ball reaches the peak.
Step 1 and Step 2 seem to work fine, but Step 3 makes the balls look unnatural, like they're being pulled up and hovering a bit before dropping. And I haven't been able to find anything that explains the upwards movement of a bouncing ball (and how it differs from the fall).
The only way I've been able to smooth out the "hovering" effect of the ball when it reaches its post-bounce peak is to start the free fall counter (time) right before the ball reaches the peak so that it gains enough velocity to drop faster....if that makes sense. That's what I mean by my comment in Step 4.
P.S. I'm not planning on accounting for friction, ball shape, density, etc. unless it would be necessary to do so. The only "extra" thing I've added in so far is the ability to change the ball's elasticity.