"Jano" <402450@cepsz.unizar.es> a �crit dans le message de news:5d6fdb61.0403120115.7c102e3c@posting.google.com... > The problem is a simple one: I'm planning to write a simulator of > sideral-like objects using the Newton laws (precision is not a top > priority). The obvious way is to compute the force interactions > between each pair of objects, sum them all, and iterate over... but > this is O(n^2). To be precise, there are n(n-1)/2 forces to be > computed if I'm right (n the number of objects). > If I remember my Newton laws correctly, you just need to compute the force between an object and the center of mass of all other objects. Hmmm.... not sure that it won't be O(n^2) still, but it might ease a bit. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr