生活随笔
收集整理的這篇文章主要介紹了
弹性碰撞问题
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
14:小球從10米高處自由下落,每次彈起的高度是下落高度的70%,
當小球彈起的高度不足原高度的千分之一時,小球很快會停止跳動,
計算小球在整個彈跳過程中所經歷的總路程(忽略彈起高度不足原高度千分之一的部分)。
?
<?php ? ????????? ? $s=0; ? $high=10; ? ? $high0=$high/1000; ? ? while(1) ? { ? ????? ????$s+=$high; ? ????$high*=0.7; ? ????if($high?<?$high0) ? ????{ ? ????????? ????????break;?? ? ????} ? ????? ????$s+=$high; ? } ? output("total:$s",true); ? error_msg("execute?success"); ? ?? ???? function?output($msg,$isClean=false) ? { ? ????if($isClean) ? ????{ ? ????$handle?=?fopen('out.txt',?'w'); ? ????fclose($handle);???? ? ????} ? ????error_log($msg."\n",?3,?"out.txt"); ? } ? ???? function?error_msg($msg,$is_exit=true) ? { ? ????if($is_exit) ? ????????die($msg."\n"); ? ????else? ????????echo?$msg."\n"; ? } ??>?? ? ? 本文轉自yifangyou 51CTO博客,原文鏈接:http://blog.51cto.com/yifangyou/618837,如需轉載請自行聯系原作者
總結
以上是生活随笔為你收集整理的弹性碰撞问题的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。