Examples Sine and Cosine

Sine and Cosine

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: Revised by Darren Kessner, Malay Vasa. Edited and maintained by p5.js Contributors and Processing Foundation. Licensed under CC BY-NC-SA 4.0.

You can find the code history of these examples here: pre-2023 example, 2023 code. You can suggest improvements by contributing to the current website!