This example demonstrates the sine and cosine mathematical functions.
The animation shows uniform circular motion around the unit circle (circle with radius 1). Any angle measured from the the x-axis determines a point on the circle. The cosine and sine of the angle are defined to be the x and y coordinates, respectively, of that point.
Sine and Cosine by p5.js Contributors and the Processing Foundation is licensed under CC BY-NC-SA 4.0.
Related Examples

A point on the unit circle, together with the corresponding sine and cosine values on their graphs.
Sine and Cosine
Animate circular, back and forth, and wave motion.

Two eyes on a black background.
Aim
Rotate toward a point.

Rainbow ring made up of triangles whose vertices lie on two concentric circles.
Triangle Strip
Split a ring into triangles.