In creative coding, sin and cos can be used for:
- Draw a wave
- Arrange items in circles and spirals
- Generate smooth periodic motion
- An ingredient of “fields”, that fill a line or space with a pattern that determines color, shape, or other qualities of drawing or motion that appears in that space.
Read
- Getting Started with p5.js, “Circular’, pp. 162–172
- Course notes:
The Nature of Code
"Trigonometry is a sine of the times." - Anonymous In Chapters 1 and 2, we carefully worked out an object-oriented structure to make something move on the screen, using the concept of a vector to represent location, velocity, and acceleration driven by forces in the environment.
natureofcode.com
Arranging Items in a Circle or Spiral
Watch
3.1: Angles and Angular Motion - The Nature of Code
Chapter: 3Official book website: http://natureofcode.com/Twitter: https://twitter.com/shiffmanThis video describes how angles work in Processing and how you ...
www.youtube.com
3.2: Trigonometry and Polar Coordinates - The Nature of Code
Chapter: 3Official book website: http://natureofcode.com/Twitter: https://twitter.com/shiffmanadded annotationsThis video describes the basics of trigonometr...
www.youtube.com
3.3: Simple Harmonic Motion - The Nature of Code
The Nature of Code (Chapter 3)http://natureofcode.com/Twitter: https://twitter.com/shiffmanThis video covers oscillating motion in Processing through the use...
www.youtube.com
3.6 Graphing Sine Wave - Nature of Code
What does a sine wave look like? In this video I look at how to graph and animate a sine wave in p5.js varying the period and phase. https://thecodingtrain.c...
www.youtube.com
Trigonometry - The graphs of sin and cos
Being able to visualize the trigonometric functions is important. This video will get you up to speed by showing you the basic graph for sine and cosine. Y...
www.youtube.com
Interact
sin() basics for Creative Coding
This is a sine wave. In p5, it is produced by plotting y = sin(x), where y loops from 0 to width. It's useful for drawing, for example, a wave shape: sin() can also be used to add periodic motion to an object: You can see the relationship between the motion (where sin() is a function of time), and the wave shape (where sin() is a function of $x$), by animating a trace of the shape position.
observablehq.com
Sine/Cosine: The Dome
Sine/Cosine: The Dome
www.desmos.com
Visualizing Sine and Cosine
Visualizing Sine and Cosine
www.geogebra.org