In this video, I tackle a common question, how do you draw an object pointing in the direction it’s moving? I demonstrate how to calculate the angle associated with the direction vector as well as create an vector from an angle in p5.js.
Link to Nature of Code book section on solving for tangent
Nature of Code video on static functions
Coding challenge on making asteroids in p5.js
- Editing
by Mathieu Blanchette
- Animations
by Jason Heglund