Bouncing Smiley Face

版本 1.2.0.0 (4.6 KB) 作者: Husam Aldahiyat
Exaggerated and somewhat cartoonish simulation of the physics of a bouncing smiley face.
3.5K 次下载
更新时间 2009/2/25

查看许可证

The laws for rotation are probably wrong (I made them up actually), but that's not what this file is about. Shown here is a very simple code that creates a nice animation, which can be quickly edited to suit anyone's needs.

The parameters are ball radius, gravity, initial velocity in the Y direction, initial velocity in the X direction, vertical speed conservation (%), horizontal speed conservation (%) and initial angular velocity.

Please note that the ball may stop moving at different locations for different trials, even with the same input parameters. This is due to the slight randomization of the deformations of the ball and the ground, which could lead to the ball getting "stuck" to the ground at times and stopping there. This is normal and deliberate.

Set the vertical speed conservation as a value larger than 100 (e.g. 130) for a small bonus ;)

引用格式

Husam Aldahiyat (2024). Bouncing Smiley Face (https://www.mathworks.com/matlabcentral/fileexchange/23081-bouncing-smiley-face), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2007a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Just for fun 的更多信息
致谢

参考作品: Bouncing Ball Physics

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.2.0.0

Code now works on systems without the Image Processing Toolbox.

1.1.0.0

Fixed eccentricity error, horizontal conservation error.

1.0.0.0