I'm looking for a TikZ library that could help me to represent different shapes of chaotic billiards.
|show 7 more comments|
This is another nice one for Asymptote, which can calculate intersections and directions of paths easily:
Here's the code for the stadium billiard:
To get the circle, uncomment the lines
and comment out the billiard path
EDIT: This question is so much fun, I had to do the Sinai billiard as well:
The code has only a few more lines:
|show 6 more comments|
For comparison, here is a translation of Alex's code to Metapost.
Increasing the amount of reflections to 500 gives:
and increasing it to 2000 gives:
which shows space filling.
If however one starts with a circle, then 2000 collisions gives:
A fun option is to add randomization to the reflection: After normalizing the tangent add
With this randomization, if you start with a circle, you get space filling (after 2000 collisions):