The atan2() function calculates the angle between two positions. The angle it calculates can be used to rotate a shape toward something. In this example, the eyes rotate to look at the cursor.
No alt text
Sine and Cosine
Animate circular, back and forth, and wave motion.
Aim
Rotate toward a point.
Triangle Strip
Split a ring into triangles.
Looking for the old p5.js site? Find it here!