Popular recipes by Steve Wadley http://code.activestate.com/recipes/users/4186942/2013-06-20T06:57:57-07:00ActiveState Code RecipesDynamical Billiards Simulation (Python)
2013-06-20T06:57:57-07:00Steve Wadleyhttp://code.activestate.com/recipes/users/4186942/http://code.activestate.com/recipes/578572-dynamical-billiards-simulation/
<p style="color: grey">
Python
recipe 578572
by <a href="/recipes/users/4186942/">Steve Wadley</a>
(<a href="/recipes/tags/chaos/">chaos</a>, <a href="/recipes/tags/graphics/">graphics</a>, <a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/pil/">pil</a>, <a href="/recipes/tags/random/">random</a>).
</p>
<p>It simulates reflections of a ball on a billiards table that has one or more circular obstacles.
(This can also be thought as a 2d ray-tracing.)</p>
<p>Most of the time the path of the ball would be chaotic (meaning, if another ball started from any slightly different location or direction then its path would be very different after a short while). </p>
<p>See Wikipedia for more info:
<a href="http://en.wikipedia.org/wiki/Dynamical_billiards" rel="nofollow">http://en.wikipedia.org/wiki/Dynamical_billiards</a></p>