@@ -293,23 +293,24 @@ end
293
293
billiard_stadium = billiard_bunimovich
294
294
295
295
"""
296
- billiard_logo(;h=1.0, α=0.8, r=0.18, off=0.25) -> bd, ray
296
+ billiard_logo(;h=1.0, α=0.8, r=0.18, off=0.25, T = Float64 ) -> bd, ray
297
297
Create the billiard used as logo of `DynamicalBilliards` and return it
298
298
along with the tuple of raysplitters.
299
299
"""
300
- function billiard_logo (;h= 1.0 , α= 0.8 , r= 0.18 , off= 0.25 )
300
+ function billiard_logo (;h= 1.0 , α= 0.8 , r= 0.18 , off= 0.25 , T = Float64 )
301
301
302
302
cos6 = cos (π/ 6 )
303
303
β = (h - cos6* α)/ cos6
304
304
t = α + 2 β
305
- center_of_mass = [0.0 , √ 3 * t/ 6 ]
306
- startloc = [- α/ 2 , 0.0 ]
305
+ (α, r, h, off, cos6, β, t) = T .((α, r, h, off, cos6, β, t))
306
+ center_of_mass = T[0.0 , √ 3 * t/ 6 ]
307
+ startloc = T[- α/ 2 , 0.0 ]
307
308
308
309
# create directions of the hexagonal 6:
309
- hexvert = [( cos (2 π* i/ 6 ), sin (2 π* i/ 6 )) for i in 1 : 6 ]
310
+ hexvert = [T .(( cos (2 π* i/ 6 ), sin (2 π* i/ 6 ) )) for i in 1 : 6 ]
310
311
dirs = [SVector {2} (hexvert[i] .- hexvert[mod1 (i+ 1 , 6 )]) for i in 1 : 6 ]
311
312
312
- frame = Obstacle{Float64 }[]
313
+ frame = Obstacle{T }[]
313
314
314
315
sp = startloc
315
316
ep = startloc + α* dirs[1 ]
@@ -319,18 +320,18 @@ function billiard_logo(;h=1.0, α=0.8, r=0.18, off=0.25)
319
320
320
321
for i in 2 : 6
321
322
s = iseven (i) ? β : α
322
- T = InfiniteWall # iseven(i) ? RandomWall : InfiniteWall
323
+ WT = InfiniteWall # iseven(i) ? RandomWall : InfiniteWall
323
324
sp = frame[i- 1 ]. ep
324
325
ep = sp + s* dirs[i]
325
326
normal = (w = ep .- sp; [- w[2 ], w[1 ]])
326
- push! (frame, T (sp, ep, normal, " frame $(i) " ))
327
+ push! (frame, WT (sp, ep, normal, " frame $(i) " ))
327
328
end
328
329
329
330
330
331
# Radii of circles that compose the Julia logo
331
- offset = [0.0 , off]
332
+ offset = T [0.0 , off]
332
333
333
- R = [cos (2 π/ 3 ) - sin (2 π/ 3 );
334
+ R = T [cos (2 π/ 3 ) - sin (2 π/ 3 );
334
335
sin (2 π/ 3 ) cos (2 π/ 3 )]
335
336
336
337
0 commit comments