Calculating stopping distance for basic spacehip physics

Hi all.

So I’m working on a little spaceship RTS type game and have encountered a problem that I’m not sure how to solve.

My ships use very simply physics (ie. not remotely realistic):
They have a current speed, an acceleration, a max speed and a turning speed.

When the player clicks to move a ship, it begins accelerating towards the clicked location, with its speed increasing at a rate of Acceleration/sec. At the same time, it rotates TurningSpeed degrees/second to face the destination.
Its speed never exceeds its max speed.

Now the situation I have is what to do when the ship gets to its destination.
I don’t want it to just stop dead, I would rather it decelerate slowly to a stop.
But how do I do this so that it lands accurately at its destination?

Does anyone have an idea for some sort of formula to calculate stopping distance?

Or to phrase like a school book math problem:
If the ship is moving at 60/sec and its speed decreases by 20/sec when decelerating, how far from the destination should it start decelerating so that it stops perfects in the right spot? :smile:

Anyone have an idea for a good solution to this?

can’t you just get the distance to move and start decelerating at the midpoint?

Yeah, you’d want to figure out the maximum stopping distance for the ship (based on the max speed) and start decelerating with the opposite force of acceleration at either that distance from the endpoint or at the midpoint of the journey (if the journey is less than twice the max stopping distance).

Yeah but how would I calculate max stopping distance, that’s the bit I’m stuck on :stuck_out_tongue: