A Zoox autonomous vehicle must estimate how far it will travel while braking to a complete stop. Given its current velocity and a constant deceleration magnitude, calculate the stopping distance using one-dimensional kinematics.
Assume the vehicle begins braking immediately, deceleration remains constant, and there is no reaction delay. The supplied deceleration is a positive magnitude, not a signed acceleration.
Implement stopping_distance(velocity, deceleration):
velocity is a nonnegative floating-point value in meters per second.deceleration is a positive floating-point value in meters per second squared.v² = u² + 2as, where the final velocity is zero and acceleration is -deceleration.def stopping_distance(velocity, deceleration):