Skip to content

t-ae/ParticleLife

Repository files navigation

Particle Life

Particle Life for macOS/Metal.

Demo

Force functions

force1

The force function described in the reference video.

$$force1(distance, attraction) = \left\{ \begin{array}{ll} -1 + \frac{distance}{beta} & (distance \le beta) \\\ attraction * \frac{1-|2*distance-1-beta|}{1-beta} & (beta \lt distance \le 1) \end{array} \right. \\\ (beta = 0.3)$$

force2

$$force2(distance, attraction) = \left\{ \begin{array}{ll} -1 + \frac{attraction+1}{beta} * distance & (distance \le beta) \\\ \frac{attraction}{beta-1} * (distance-1) & (beta \lt distance \le 1) \end{array} \right. \\\ (beta = 0.65)$$

force3

Combination of force1 and force2.

$$force3(distance, attraction) = \left\{ \begin{array}{ll} force1(distance, attraction) & (attraction \ge 0) \\\ force2(distance, attraction) & (attraction \lt 0) \end{array} \right.$$

Reference

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published