Handbook
Glossary
quark
Vocabulary
bubble-chamber
Definition
IN:
bubble-chamber
TUPLE:
quark
<
particle
;
Methods
USING:
accessors
bubble-chamber
kernel
math
;
M:
quark
collide
dup
center
>>pos
dup
collision-theta
-0.11 0.11
2random
+
>>theta
0.5 3.0
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
drop
;
USING:
accessors
arrays
bubble-chamber
colors
kernel
math
namespaces
processing.shapes
random
sequences
;
M::
quark
move
( QUARK -- )
QUARK
bubble-chamber>>
size>>
first
:>
WIDTH QUARK
dup
myc>>
>rgba-components
drop
0.13
<rgba>
stroke-color
set
dup
pos>>
draw
dup
pos>>
first2
[
WIDTH
swap
-
]
dip
2array
draw
[
]
[
vel>>
]
bi
move-by
turn
step-theta
step-theta-d
step-speed-mul
1000
random
997
>
[
dup
speed>>
neg
>>speed
2
over
speed-d>>
-
>>speed-d
]
when
dup
out-of-bounds?
[
collide
]
[
drop
]
if
;