This example demonstrates a ball bouncing on a slanted surface, implemented using vector calculations for reflection.
The code makes extensive use of the p5.Vector class, including the createVector() function to create new vectors, and the vector methods add() and dot() for the vector calculations.
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.