NatureOfCode

P5.js


Project maintained by OlgaTorok Hosted on GitHub Pages — Theme by mattgraham

Home

Vectors and Motion

In this chapter we learn how to code in P5 by using Vectors and Motion.

The exercises covered are:

  1. Moving Ball in x Direction - No Vectors
  2. Bouncing Ball - No Vectors
  3. Bouncing Ball - With Vectors
  4. Vector Addition
  5. Vector Subtraction
  6. Vector Multiplication
  7. Vector Magnitude
  8. Normalising Vectors
  9. Vector Motion - Velocity
  10. Vector Motion - Constant Acceleration
  11. Vector Motion - Random Acceleration
  12. Vector Motion - Acceleration Towards Mouse
  13. Vector Motion - An Array of Movers
  14. Follow the Mouse