It seems like newVelos is really storing accelerations. Maybe rename to accels?
You probably don't want to allocate this anew each time animate is called.
It might be nicer/faster to use new Float32Array which automatically fills things with 0s and will use less storage/bandwidth than a vanilla Array which will use 64-bit floats. It also provides some runtime type information that could yield better code generation.
https://github.com/pablo-mayrgundter/celestiary/blob/5c8e5f2b32272cf07a95f450987bb16596acbba8/js/Galaxy.js#L68
newVelos
is really storing accelerations. Maybe rename toaccels
?new Float32Array
which automatically fills things with 0s and will use less storage/bandwidth than a vanillaArray
which will use 64-bit floats. It also provides some runtime type information that could yield better code generation.