@@ -32,7 +32,7 @@ refraction angle and optionally new angular velocity after transmission. These f
32
32
``` @docs
33
33
RaySplitter
34
34
```
35
- ---
35
+
36
36
If you want different type of transmission/refraction functions for
37
37
different obstacles, then you define multiple ` RaySplitter ` s.
38
38
@@ -83,6 +83,8 @@ If you have many instances of `RaySplitter` you pass a tuple of them.
83
83
84
84
For example,
85
85
``` @example ray
86
+ using Random
87
+ Random.seed!(42)
86
88
p = randominside(bd, 1.0)
87
89
raysplitters = (raywall, raya)
88
90
xt, yt, vxt, vyt, tt = timeseries(p, bd, 100, raysplitters)
@@ -97,12 +99,13 @@ You can see that at some points the particle crossed the boundaries of the
97
99
red obstacles, which allow for ray splitting. It is even cooler to animate
98
100
this motion using [ ` animate_evolution ` ] ( @ref ) !
99
101
102
+ ``` @raw html
100
103
<video width="100%" height="auto" controls>
101
104
<source src="https://raw.githubusercontent.com/JuliaDynamics/JuliaDynamics/master/videos/billiards/ray.mp4?raw=true" type="video/mp4">
102
105
</video>
106
+ ```
103
107
104
-
105
- !!! warning "Resetting the billiard"
108
+ !!! info "Resetting the billiard"
106
109
Notice that evolving a particle inside a billiard always mutates the billiard
107
110
if ray-splitting is used. This means that you should always set the fields
108
111
` pflag ` of some obstacles to the values you desire after * each* call
@@ -112,11 +115,10 @@ this motion using [`animate_evolution`](@ref)!
112
115
The function `reset_billiard!(bd)` turns all `pflag`s to `true`.
113
116
114
117
115
- !!! important "Angle of refraction is clamped"
118
+ !!! warning "Angle of refraction is clamped"
116
119
Internally we clamp the output of the angle of refraction function. Let ` c = DynamicalBilliards.CLAMPING_ANGLE ` (currently ` c = 0.1 ` ). We clamp ` θ ` to
117
120
` -π/2 + c ≤ θ ≤ π/2 - c ` . This is so that the relocating algorithm does not fall into an infinite loop.
118
-
119
- You can change the value of `c` but very small values can lead to infinite loops in extreme cases.
121
+ You can change the value of ` c ` but very small values can lead to infinite loops in extreme cases.
120
122
121
123
## The Ray-Splitting Algorithm
122
124
In this section we describe the algorithm we follow to implement the ray-splitting
@@ -191,12 +193,14 @@ ps = [Particle(0.1, y, 0.0) for y in 0.4:0.05:1.1]
191
193
192
194
# animate
193
195
animate_evolution (ps, bd, 2.0 , rs, colors = [" C0" for i ∈ 1 : length (ps)],
194
- tailtime= 2.5 , savename = " lens" )
196
+ tailtime= 2.5 , savename = " lens" )
195
197
```
198
+
199
+ ``` @raw html
196
200
<video width="100%" height="auto" controls>
197
201
<source src="https://raw.githubusercontent.com/JuliaDynamics/JuliaDynamics/master/videos/billiards/lens.mp4?raw=true" type="video/mp4">
198
202
</video>
199
-
203
+ ```
200
204
201
205
202
206
## Example of Affecting Multiple Obstacles
@@ -229,6 +233,8 @@ xlim(-1, 2); ylim(-1, 2);
229
233
animate_evolution (p, bd, 10.0 , (ray,); ax = gca (), savename = " inverse" , tailtime = 3.0 )
230
234
```
231
235
236
+ ``` @raw html
232
237
<video width="100%" height="auto" controls>
233
238
<source src="https://raw.githubusercontent.com/JuliaDynamics/JuliaDynamics/master/videos/billiards/inverse.mp4?raw=true" type="video/mp4">
234
239
</video>
240
+ ```
0 commit comments