calculation of stopping distance