c - Update position of a point -


My problem is:

I have a set of digits in the 3D space, and their The situation is updated from time to time with a certain velocity but I need to keep a minimum distance between them.

Can you help me with this?

EDIT: I am using C for the implementation of algorithms.

Thanks in advance.

/ div>

You can also use a physics simulation. There are more possibilities than this, but at higher computational cost. For example, others suggest the collision detection, but in your comments on Daphimo, you suggest that you can choose a smooth recession to avoid collision. In this case, you can push an inter-particle force away from each other, and then use your one = F / m to move your You can calculate velocity, and v = v0 + dt one , where F contains all the particles Is the sum of strength. For example, for an intra-particle force, you can use something that looks like one of these:

Computed from the Python Code below. But in fact nothing can work until it is enough near your minimum distance (such a digit never comes together), and this is equal to zero to some distance (in this way the numbers are always one second Not changed from).

If f & lt ; 0: f = 0. If f> Fmax: Returns fmax except: f = fmax return fx = arange (0, 100, .01) r = 0. * x for the range (0, 10): I, xw enmeter (x): r [i] = Ripples (xv, 2. C) plot (x, r) show ()


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -