I am simulating a slot machine spinning and would like to start with an initial velocity and gradually apply a negative acceleration until the total displacement has reached the desired slot. The issue I'm having is: unless I carefully tune the parameters (initial velocity), the slot spins past its target and then reverses direction and finally lands on the correct face.
I used the standard motion equation
displacement = initial_velocity*delta_time + 1/2*acceleration*delta_time^2
to derive the equation for acceleration
acceleration = (2*total_displacement - 2*initial_velocity*delta_time) / delta_time^2
Is there any equation which will tell me what acceleration to use if I want to land directly on the target without reversing? Is acceleration the right concept? I'd greatly appreciate any insights into this issue.
The above equations are correct and shouldn't result in any backwards spinning if used correctly. I was simply running the simulation past the total duration described in the equation (
deltaTime), which resulted in a reversal of the velocity direction.See @Saranga B great answer for even more accurate equations to model a spinning slot, using rotation-based physics.