1.5 A Unit Vector
In this video, I explain the concept of a “unit vector,” what it means to “normalize” a vector, and take a look at the p5.js functions: p5.Vector.mag(), p5.Vector.normalize(), p5.Vector.setMag().
- p5 reference entry for the p5.Vector mag method 
- p5 reference entry for the p5.Vector normalize method 
- p5 reference entry for the p5.Vector setMag method 
- Source code for the p5.Vector normalize method 
- Source code for the p5.Vector setMag method 
- Editingby Mathieu Blanchette 
- Animationsby Jason Heglund