Handbook
Glossary
hadron
Vocabulary
bubble-chamber
Definition
IN:
bubble-chamber
TUPLE:
hadron
<
particle
;
Methods
USING:
accessors
bubble-chamber
colors
kernel
math
math.constants
;
M:
hadron
collide
dup
center
>>pos
2
pi
*
1random
>>theta
0.5 3.5
2random
>>speed
0.996 1.001
2random
>>speed-d
0
>>theta-d
0
>>theta-dd
[
0.00001
theta-dd-small?
]
[
-0.001 0.001
random-theta-dd
]
while
0 1 0 1
rgba
boa
>>myc
drop
;
USING:
accessors
bubble-chamber
colors.gray
kernel
math
math.points
namespaces
processing.shapes
random
;
M:
hadron
move
T{
gray
{
gray 1
}
{
alpha 0.11
}
}
stroke-color
set
dup
pos>>
1
v-y
draw
T{
gray
{
gray 0
}
{
alpha 0.11
}
}
stroke-color
set
dup
pos>>
1
v+y
draw
dup
vel>>
move-by
turn
step-theta
step-theta-d
step-speed-mul
1000
random
997
>
[
1.0
>>speed-d
0.00001
>>theta-dd
100
random
70
>
[
dup
collide
]
when
]
when
dup
out-of-bounds?
[
collide
]
[
drop
]
if
;