Handbook
Glossary
update-velocity ( other-body body dt -- )
Vocabulary
benchmark
.
nbody
Inputs
other-body
an
object
body
an
object
dt
an
object
Outputs
None
Definition
USING:
accessors
kernel
math
math.vectors
;
IN:
benchmark.nbody
::
update-velocity
( other-body body dt -- )
dt body other-body
mag
[
[
body
]
2dip
[
[
[
other-body
mass>>
]
]
dip
[
*
]
curry
compose
]
dip
[
n*v
v-
]
curry
compose
change-velocity
drop
]
[
[
other-body
]
2dip
[
[
[
body
mass>>
]
]
dip
[
*
]
curry
compose
]
dip
[
n*v
v+
]
curry
compose
change-velocity
drop
]
2bi
;