Mutual Attraction

Nature of Code Lesson #2.6

Finishing off Chapter 2 on forces, let’s look at an “N-Body Simulation” where all movers experience gravitational attraction with all other movers!

icon for p5js Mutual Attraction (N-Body)
icon for p5js Mutual Attraction (N-Body) with Barnes Hut