Demonstration of multiple forces acting on bodies. Bodies experience gravity continuously. Bodies experience fluid resistance when in “water”. (natureofcode.com)
The force calculations are performed using the p5.Vector class, including the createVector() function to create vectors.
Related Examples

No alt text
Non-Orthogonal Reflection
Simulate a ball bouncing on a slanted surface.

No alt text
Soft Body
Simulate the physics of a soft body accelerating toward the mouse.

No alt text
Forces
Simulate forces on multiple bodies as they move through liquid.

No alt text
Smoke Particles
Simulate smoke with a particle system.

No alt text
Game of Life
Recreate John Conway's cellular automaton.

No alt text
Mandelbrot Set
Visualize a mathematical set that produces fractal structures.