Examples Non-Orthogonal Reflection

Non-Orthogonal Reflection

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.

Non-Orthogonal Reflection: Based on Processing example by Ira Greenberg. Ported by David Blitz. Revised by Darren Kessner. From 2024 onwards, edited and maintained by p5.js Contributors and Processing Foundation. Licensed under CC BY-NC-SA 4.0.

You can find the code history of these examples here: 2023 code. You can suggest improvements by contributing to the current website!