2 USING: kernel arrays sequences random
7 multi-methods accessors
12 bubble-chamber.particle
13 bubble-chamber.particle.muon.colors ;
15 IN: bubble-chamber.particle.muon
17 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
19 TUPLE: muon < particle ;
21 : <muon> ( -- muon ) muon new initialize-particle ;
23 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
25 METHOD: collide { muon }
28 2 32 [a,b] random >>speed
29 0.0001 0.001 2random >>speed-d
31 collision-theta> -0.1 0.1 2random + >>theta
35 [ 0.001 theta-dd-small? ] [ -0.1 0.1 random-theta-dd ] [ ] while
42 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
46 dup myc>> 0.16 >>alpha stroke
49 dup mya>> 0.16 >>alpha stroke
50 dup pos>> first2 >r dim swap - r> 2array point
53 [ speed>> ] [ theta>> { sin cos } <arr> ] bi n*v
60 out-of-bounds? [ collide ] [ drop ] if ;
62 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!