update-velocity ( other-body body dt -- )


Vocabulary
benchmark.nbody

Inputs
other-bodyan object
bodyan object
dtan object


Outputs
None

Definition


:: update-velocity ( other-body body dt -- )
dt body other-body mag [
[ body ] 2dip
'[ other-body mass>> _ * _ n*v v- ] change-velocity drop
] [
[ other-body ] 2dip
'[ body mass>> _ * _ n*v v+ ] change-velocity drop
] 2bi ;