Calculating an object's stopping distance
Considering this as a uniformly accelerated linear motion problem with given velocity and (negative) acceleration, you could use:

function getStoppingDist(speed, accel) {
  var dist = 0.5*Math.pow(speed,2)/accel;
  return dist;
}