Using a 3D virtual simulation software, I coded and simulated the effects of gravity and friction of a ball bouncing in a box.
http://www.glowscript.org/#/user/Henry.701/folder/Public/program/Ballinabox/edit
Follow the link and press Run this program