Re:Modeling Physics in Javascript: Gravity and Drag
by Steuard on Saturday September 08, 2012 @12:53PM
(#4493312)
Right, chaotic behavior is a valid issue. But in any realistic situation, you'll have lots of effects that inevitably get left out of simulations that contribute larger perturbations/errors than this rounding error would. (Heck, I suspect that even the thermal motion of the individual atoms in an object would have a larger effect.)
So no simulation will ever get exactly the "right" answer at that level. For practical purposes, all we care about is getting an answer that's within the ensemble of reasonable outcomes for initial conditions like ours.
But as I stated earlier, I think I have to check first because I am not that convinced any more on the performance point of view that JS has a problem, and float representation is not a JS problem, but a problem global to all CPUs.
Well it can be more than 10^-12 sometimes and the problem is not in physics but in trading when errors stack up. That's why I prefer when e-commerce solutions are based on fixed point arithmetic.
Even though canvases are still not homogeneous in terms of performance from browsers to browsers, some works fairly well.